How to use Sip debug in Asterisk?

Asked

Viewed 4,575 times

1

In Asterisk software, it is possible to debug a phone number only? without it being peer from my server?

I know there are commands:

    sip set debug peer 1000
    sip set debug ip 172.16.0.100

similarly to debug it is possible to control the verbose for only one user?

if it is not possible there is some standardized way to make tests of this type in production? to filter calls incomming

2 answers

3


Hello, I will try to answer the split questions.

1- In Asterisk software, it is possible to debug a phone number only? without it being peer from my server?

You can filter through the IP of this peer, as you already know, but if this is not enough you can use wireshark and filter the captures by voip calls, by source ip, destination, package content (filtering by peer, for example) etc.

Reading suggestion: Wireshark - Voip Calls

2- Similarly to debug it is possible to control the verbose for only one user?

Yeah, but by the log instead of the CLI. You can filter calls to only one user through the Asterisk log, as long as the verbose log is enabled in the /etc/Asterisk/logger.conf Example:

full => notice,warning,error,verbose,dtmf,fax

From Asterisk 11 every call has an identifier (call-id) which makes it possible to track it in the log. Example:

[2017-04-11 09:17:02] VERBOSE[50999][C-00000620] pbx.c: Executing [1234@CONTEXTO-PADRAO:1] NoOp("SIP/PEERQUALQUER-00000507", "### RECEBENDO CHAMADA DE 1234567890 PARA 1234 ###") in new stack

On the above line you can see that Asterisk received a call from the PEERQUALQUER peer to the 1234 extension. All lines of this call have the [C-00000620] identifier that can be filtered with a 'grep', for example:

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

Reading suggestion: Call Identifier Logging

3- If it is not possible there is some standardized way to make tests of this type in production? to filter calls incomming

I use the log file data to filter and analyze incoming calls. When I want more details, mainly of signaling, I use the sngrep for real-time analysis of SIP messages, dialogues and transactions. I use wireshark for pcap file analysis when I don’t need real-time analysis.

1

You can use the SNGREP to monitor direct at the terminal has a very detailed output, it is designed to monitor SIP traffic.

It is a lightweight and very useful tool in everyday life, follows the project gitbub.

https://github.com/irontec/sngrep

Browser other questions tagged

You are not signed in. Login or sign up in order to post.