Asterisk SIP Troubleshooting command line .VOIP communication common protocol is SIP .
SIP Troubleshooting is very important in VOIP. Below are some basic command used in SIP Troubleshooting.
sngrip Capture and Analyse SIP Packets on the Command Line
yum install sngrep
apt-get install sngrep
For more details visit :- https://falkus.co/2018/07/sngrep-capture-and-analyse-sip-packets/
Check Asterisk Version
core show version
vicibox10*CLI> core show version Asterisk 13.38.3-vici built by abuild @ cloud114 on a x86_64 running Linux on 2022-11-06 02:00:53 UTC
Asterisk up Time
core show uptime
vicibox10*CLI> core show uptime System uptime: 2 days, 18 hours, 35 minutes, 54 seconds Last reload: 2 days, 18 hours, 35 minutes, 54 seconds
Restart Asterisk
asterisk -rx ‘reload now’
Enable SIP debug
sip set debug on
sip set debug peer <peer name>
sip set debug ip <ip address>
sip set debug off
FreePBX Start Stop Restart More details
amportal stop
amportal start
amportal restart its restart freepbx and asterisk
[root@localhost ~]# amportal restart Please wait... STOPPING ASTERISK Waiting for Asterisk to Stop Gracefully... Asterisk Stopped SETTING FILE PERMISSIONS Permissions OK STARTING ASTERISK Asterisk Started [root@localhost ~]# [root@localhost ~]# amportal stop Please wait... STOPPING ASTERISK Waiting for Asterisk to Stop Gracefully... Asterisk ended with exit status 0 Asterisk shutdown normally. Asterisk Stopped [root@localhost ~]# [root@localhost ~]# amportal start Please wait... SETTING FILE PERMISSIONS Permissions OK STARTING ASTERISK Asterisk Started [root@localhost ~]#
core set debug 5 : set the core debug to level 5
core set verbose 9 : set verbosity level to 9
Degbugging one way Voice issues
rtp set debug {on|off|ip} — Enable/Disable RTP debugging
Voice Packet Issues More Details
rtcp set debug {on|off|ip} — Enable/Disable RTCP debugging
rtcp set stats {on|off} — Enable/Disable RTCP stats
rtp set debug {on|off|ip} — Enable/Disable RTP debugging
cat full |grep UNREACHABLE
Type “exit” and hit enter to get back to the main command line prompt for your PBX
Type “cd /var/log/asterisk” to view all of the logs
Type “tail full” to view the full logs only
Type “asterisk -r” to go back and write the command to remove debugging
Type “sip set debug off” to turn off debugging, to avoid information overload when viewing your logs
Type “exit” and hit enter to go back to the main command line prompt for your PBX
Type “more full : grep 100” to give you all of the messages that include “100” (if different, replace 100 with the
extension number that you created)
Type “more full : grep -i unreachable” to view logs that indicate the extension was unreachable