[asterisk-users] Sip cause and response codes in dialplan

Marcus Kvarsell Marcus.Kvarsell at fogwise.se
Tue Feb 20 08:52:37 CST 2018


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



More information about the asterisk-users mailing list