Marcus Kvarsell
2018-Feb-20 13:09 UTC
[asterisk-users] Sip cause and response codes in dialplan
Hi, I am experimenting with getting hold of the sip cause and sip response from outgoing call. How could i make a userevent printing the sip cause and/or sip response. I have tried using hangupcause, sip_cause and such , but i am not getting any data. I would at least like to use the q.850 reason codes in the dialplan which i now am unable to do. Any help appreciated. [Beskrivning: Fogwise - logotype] Marcus Kvarsell phone: +46766350384 e-mail: marcus at fogwise.se url: http://www.fogwise.se Like us on facebook: https://www.facebook.com/WiseDialer<https://www.facebook.com/WiseDialer/app_362387440529737> Follow us on LinkedIn https://www.linkedin.com/company/fogwise-ab FOGWISE AB Fleminggatan 2 SE-602 24 Norrk?ping Sweden -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180220/20a0aa8e/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 1134 bytes Desc: image001.gif URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180220/20a0aa8e/attachment.gif>
Antony Stone
2018-Feb-20 14:14 UTC
[asterisk-users] Sip cause and response codes in dialplan
On Tuesday 20 February 2018 at 14:09:05, Marcus Kvarsell wrote:> Hi, > > I am experimenting with getting hold of the sip cause and sip response from > outgoing call. How could i make a userevent printing the sip cause and/or > sip response. I have tried using hangupcause, sip_cause and such , but i > am not getting any data.You don't say which version of Asterisk you're using, so I can't guarantee that the following will work for you, but I got this to work using Asterisk 11.13.1: In sip.conf, under the [general] stanza, define: storesipcause=yes You will get a warning to use hangupcause instead, but I haven't got that to do the same thing, so it's no substitute, I think. Then, in your Dial() command, use M() to call a macro when the call gets answered. https://www.voip-info.org/wiki/view/Asterisk+cmd+Dial In the macro definition, you can use ${HASH(SIP_CAUSE,${CDR(channel)})} to get the SIP response code. It returns values such as "SIP 200 OK". Hope that helps, Antony. -- I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are _obviously_ no deficiencies, and the other way is to make it so complicated that there are no _obvious_ deficiencies. - C A R Hoare Please reply to the list; please *don't* CC me.
Marcus Kvarsell
2018-Feb-20 14:52 UTC
[asterisk-users] Sip cause and response codes in dialplan
Hi, i am using asterisk 15, and thank you very much for your insights. I will definately try this. / Marcus -----Ursprungligt meddelande----- Fr?n: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] F?r Antony Stone Skickat: den 20 februari 2018 15:14 Till: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com> ?mne: Re: [asterisk-users] Sip cause and response codes in dialplan On Tuesday 20 February 2018 at 14:09:05, Marcus Kvarsell wrote:> Hi, > > I am experimenting with getting hold of the sip cause and sip response > from outgoing call. How could i make a userevent printing the sip > cause and/or sip response. I have tried using hangupcause, sip_cause > and such , but i am not getting any data.You don't say which version of Asterisk you're using, so I can't guarantee that the following will work for you, but I got this to work using Asterisk 11.13.1: In sip.conf, under the [general] stanza, define: storesipcause=yes You will get a warning to use hangupcause instead, but I haven't got that to do the same thing, so it's no substitute, I think. Then, in your Dial() command, use M() to call a macro when the call gets answered. https://www.voip-info.org/wiki/view/Asterisk+cmd+Dial In the macro definition, you can use ${HASH(SIP_CAUSE,${CDR(channel)})} to get the SIP response code. It returns values such as "SIP 200 OK". Hope that helps, Antony. -- I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are _obviously_ no deficiencies, and the other way is to make it so complicated that there are no _obvious_ deficiencies. - C A R Hoare Please reply to the list; please *don't* CC me. -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users