How to use sip debug in asterisk?

1

In Asterisk software, is it 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

In a similar way to debug it is possible to control verbose for only one user?

If it is not possible, is there any standardized way to do this type of testing in production? to filter incomming calls

    
asked by anonymous 01.02.2017 / 20:30

2 answers

3

Hello, I'll try to answer the questions in parts.

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

You can filter by 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, packet content (filtering by peer, for example) etc.

Suggested Reading: Wireshark - Voip Calls

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

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

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

From asterisk 11 every call has a call-id ( call-id ) that makes it possible to trace 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

In the above line you can see that asterisk has received a call from the peer PEERQUALQUER for extension 1234. All lines in this call have the identifier [C-00000620] that can be filtered with a grep, for example: / p>

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

Suggested Reading: Call Identifier Logging

3- If it is not possible, is there any standardized way to do such tests in production? to filter incomming calls

I use log file data to filter and analyze incoming call flows. When I want more details, especially signage, I use the sngrep for real-time analysis of messages, SIP transactions. I use wireshark for pcap file analysis when I do not need real-time analysis.

    
13.04.2017 / 14:44
1

You can use SNGREP to directly monitor the terminal to have a very detailed output, it is designed to monitor SIP traffic.

It is a lightweight and very useful tool in the day to day, it follows the gitbub of the project.

link

    
18.07.2018 / 15:04