0% found this document useful (0 votes)
283 views

Multiple Ips and Subnet Support: Pjsip Set Logger On Pjsip Show Endpoints Pjsip Show Registrations

The document provides instructions for monitoring and troubleshooting SIP and Asterisk services. It describes commands to enable logging and view logs for PJSIP and Asterisk. It also introduces sngrep as a network monitoring tool and provides commands for capturing network traffic with tcpdump. Troubleshooting steps are outlined for identifying issues in dialplan logic or application logic from Asterisk console output and logs.

Uploaded by

smail
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
283 views

Multiple Ips and Subnet Support: Pjsip Set Logger On Pjsip Show Endpoints Pjsip Show Registrations

The document provides instructions for monitoring and troubleshooting SIP and Asterisk services. It describes commands to enable logging and view logs for PJSIP and Asterisk. It also introduces sngrep as a network monitoring tool and provides commands for capturing network traffic with tcpdump. Troubleshooting steps are outlined for identifying issues in dialplan logic or application logic from Asterisk console output and logs.

Uploaded by

smail
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

sip set debug on

sip reload
sip show registry

pjsip set logger on


pjsip show endpoints
pjsip show registrations

sngrep is a nice monitoring tool that comes preinstalled with Distro SNG7.
It’s easier to follow the SIP traffic than it is with sip debug from the command line which is easily clutterd
with messages you don’t need to see
if not installed you can install it with yum install sngrep

Multiple IPs and Subnet Support


The “pjsip set logger host” CLI command now supports specifying a subnet mask, for example:

pjsip set logger host 172.16.1.0/255.255.255.0

As well you can now use the “add” command to have an additional host or subnet logged:

pjsip set logger add 172.16.1.0/255.255.255.0

Console Disabling Support


In some cases you may not want PJSIP logging to go to the console. There is now a CLI command to
toggle this on and off:

pjsip set logger verbose off

PCAP Output Support


Finally a really handy option is the ability to output messages in a pcap file, so you can later filter and view
in such tools as Wireshark:

pjsip set logger pcap /tmp/packets.cap

Packets are placed into the pcap as UDP packets in all cases and they are unencrypted. This even applies
if you are using, for example, SIP over Websockets with TLS.

tail -f /var/log/kamailio/kamailio.log
STEP 1: Set the debug to a value higher than 1. For that you can use the following command:
kamctl fifo debug 3

STEP 3: Inspect the /var/log/kamailio/kamailio.log file and check for errors.


STEP 4: You may also need to inspect your SIP traffic using the following command:
tcpdump -nni any -s 0 udp -w file_name.pcap.

Troubleshooting Asterisk 
To troubleshoot Asterisk, take the following steps:
STEP 1: Set your logging level to /etc/asterisk/logger.conf and reload Asterisk logger module.
This allows an easier reading of the dialplan flow.
[logfiles]
console => notice,warning,error ; what to log on console
asterisk -rx 'logger reload'

STEP 2: Open your Asterisk console and run a test call.


asterisk -rcvvvvvvvvvvv

STEP 3: Look through the console output and check whether your call ended in the dialplan
logic or in some application logic.
In order to find this out, you need to identify the last application run in the console log before the
hangup/crash and verify if any application errors or warnings occurred. If the last application
exited smoothly or no application was run, this means the dialplan logic ended the call and the
issue should be debugged at the dialplan level. 
STEP 4: If an application reported an error, then turn on debug mode in logger.conf and identify
the last application that was run, along with the debug messages logged by this application.

tcpdump -i eth0 -w test.pcap


where -i = interface, -w = write & test = filename

To capture everything including the RTP payload, simply use the


command below.
tcpdump -i eth0 -s 0 -w test.pcap
where -i = interface, -s 0 = capture size is everything, -w = write &
test = filename

grep "C-00000620" /var/log/asterisk/full

You might also like