Tips & best practices for asterisk troubleshooting & parsing logs
Tags: asterisk, call, call id, CEL, channel id, log application, variable 2, Verbose
Hi Douglas,
You;re right, that method is useful only for one-to-one call but as soon as
the call gets transferred etc etc as you mentioned everything will get
mixed and confusing.
Any way I this can be done? Can’t a call be passed off from one channel to
> another, which would leave me with only seeing a part of the logs for the
> life of the call if I only grep the logs based on one channel id?
Yes, is the answer if you want this to implement. You need to do the
following in order to achieve an start-end logging of a call.
1- As soon as call Enters Asterisk dialplan save its UNIQUEID (plus any
other key i.e timestamp ) in a CALL-IDENTIFY variable.
2- Use the CALL-IDENTIFY variable throughout your dialplan contexts to
verbose() useful information.(I saw a log() application in asterisk 1.8.5
to do this in a the log file…i.e print logs of your own)
Another interesting thing for this purpose would be CEL, though it maynot
be available in your older deployments. I haven’t toyed around with CEL
myself but so far I’ve the impression that its a very verbose form of CDRs.
So using CEL to keep track of your call in a DB would help as well.
Another Idea is to use the SIP-Header Call-ID as your CALL-IDENTIFY
variable. This way when you’re debugging the issue using asterisk logs
alongside taking SIP-traces it’ll help you identify which packets belongs
to which log lines.
Wireshark is a great tool. I take Sip traces, open up in wireshark goto
voip calls and you’ll see all the calls that were at-least initiated after
when u started the trace. Apply filter on your specific call and see only
sip traces relevant to one particular call.
Thats all I could come up at this time.
I hope this would be of some help.