Debug call handling

1. Acquire root access

2. Set log level, which is enough for logging of call handling:

# asterisk -rx "core set verbose 3" 

3. Initiate call, for example, to number 0442404040

4. Open execution log file /var/log/asterisk/messages.
Perform search of part of called number, for example 2404040 (044 is city code and could be cut by your originating partner).
Instruction on working with log files is described in section How to work with log file.

6. You'll find string on this type

Executing [0442404040@softswitch:1] MSet("SIP/small_customer_gw1-0000da42", "CALLEE_ID=0442404040") in new stack

Here:
MSet - application from Call handler. In this case it corresponds to application Set.
softswitch - name of a Call handler, in context of which current handling is performed
SIP/small_customer_gw1-0000da42 - the name of inbound SIP channel, "small_customer_gw1" - the name of inbound peer.

7. For further search on the flow of execution perform search not for 2404040, because further this number can be changed during call handling, but for channel name.
For our case this is SIP/small_customer_gw1-0000da42.
Press F7 and paste SIP/small_customer_gw1-0000da42.

8. Perform search until you'll get to last instruction.
This way you'll follow all the path of call handler execution and can find out on which application call handling has terminated.
Next, you could use section Applications, to check arguments, which have been passed to application to find a reason of termination.
Also you could check log file /var/log/smartswitch/messages for the logged line at the same time when application has been executed to find some warning or error message (for this Logging for Asterisk should be turned on).

9. Logging to file might quickly overflow disk space, thus after debugging is finished you should turn off logging:

# asterisk -rx "core set verbose off" 

Русский перевод