Capture Carrier SIP Termination Code

Here is a sample SIP conversation for a failed call:

image

I need to capture that final 404 somehow in dialplan, agi, whatever, and write it into a database. But I have not managed it. Using FreepBX 14, Asterisk 13

I’ve googled, tried a number of solutions and been playing with this for a month, but can’t seem to get it. Getting the ISUP in CDR would also be nice, but haven’t managed that either. Doesn’t seem like it should be this difficult. Any help appreciated.

Have you checked the /var/log/asterisk/full log to see what Asterisk thinks is happening when the line drops?

I am not trying to debug, I need to capture data into database. I have no trouble capturing SIP 500/404/etc. in the CLI, but I need to capture it into a database/call log field with the call uniqueid to track carrier response. Client asked me if I could capture ISUP and the SIP response to outbound calls and I said, “Sure!” (I hate when by mouth goes off before my brain.) I thought there was a CDR config parameter to include this. So far the only thing I have found is parse the log from PHP using some sed-grep-awk script nightmare.

Turn on the appropriate SIP DEBUG - all of the information from that will be logged into the /var/log/asterisk/full file. The CDR file is not going to help you in any way, you need (at least) the debug enable “full” file and possible the wireshark info from your watching the line.

Thanks, Dave, but you are missing the point. I know how to see everything the CLI and wireshark, I want to programmatically add the SIP term code and ISUP to a database via the dialpan or an AGI.

I have been using a tool called voipmonitor, which is a commercial GUI with an open-source capture & storage component. Both are very powerful and it seems to me like you could use the open-souce part to capture SIP and record information to your database, then filter it later with queries. You don’t need to install or buy the GUI part in order to capture & write to database. Just an idea. I don’t know how to do what you are asking all within Asterisk itself.

Link: http://www.voipmonitor.org

Schema info: http://www.voipmonitor.org/doc/Database_structure

1 Like

Thanks, this looks good if I can get by with opensource. The GUI is very pretty, but VERY expensive for all our channels. (Thousands). Trying it out.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.