[asterisk-users] Is there a variable for SIP response codes?

Eric "ManxPower" Wieling eric at fnords.org
Sun Apr 8 08:48:54 MST 2007


I am assuming this:

Call comes in, the Dial happens and for whatever reason the destination 
cannot be reached.  You then want to play a message to the caller.

Just put the "g" option on the end of Dial and then check the 
HANGUPCAUSE.  The destination has already hungup, but the caller has not.

The extensions.conf.sample has something similar in the (I think) 
[macro-stdexten]

Eric Bishop wrote:
> Once the call is hung up it is too late. I need to interpret the SIP
> response codes prior to hangup so I can play an appropriate recorded voice
> announcement.
> 
> 
> On 4/9/07, Eric ManxPower Wieling <eric at fnords.org> wrote:
>>
>> Eric Bishop wrote:
>> > Hi all,
>> >
>> > I want to implement certain actions based on SIP response codes. Is
>> there a
>> > similar variable such as ${DIALSTATUS} that comes back with the 
>> relevant
>> > SIP
>> > response code for a call?
>>
>> I believe there is SIPGetHeader, but Asterisk tries to translate
>> whatever code it gets from the specific technology (PRI, SIP, IAS2,
>> MGCP, SCCP, H323, etc) into an Asterisk HANGUPCAUSE which is mostly
>> Q.931 codes.  HANGUPCAUSE will not tell you the SIP response code, but
>> it will tell you much more than DIALSTATUS will.
>> _______________________________________________


More information about the asterisk-users mailing list