[asterisk-dev] resending cause codes

Klaus Darilion klaus.mailinglists at pernau.at
Tue Nov 30 03:57:01 CST 2010



Am 30.11.2010 10:21, schrieb marek cervenka:
> hello,
>
> i know that my question is partially "user question" but i think i
> want something which isn't possible now. please give me a direction how to
> implement
>
> i'm testing sending ISDN cause codes to customer pbx (below example
> scenario for unallocated number)
>
> topology:
> PSTN-E1-AsteriskA-sip-AsteriskB-sip-SOMEPBX
>
> call from SOMEPBX to PSTN (to unallocated number)
>
> AsteriskA sends to AsteriskB
> Status-Line: SIP/2.0 503 Service Unavailable
>     X-Asterisk-HangupCause: Unallocated (unassigned) number
>     X-Asterisk-HangupCauseCode: 1
>
> ${HANGUPCAUSE} on AsteriskB is 34 (asterisk translation of sip/503)
>
> how can i resend X-Asterisk-HangupCauseCode from AsteriskB to SOMEPBX?
>
> i'm tried this on AsteriskB
> exten =>  _X.,1,Dial(SIP/AsteriskA,${EXTEN})
> exten =>  _X.,n,Hangup(${SIP_HEADER(X-Asterisk-HangupCauseCode)})
> but no success
>
> why i cannot read X-Asterisk-HangupCauseCode?
> ${SIP_HEADER(X-Asterisk-HangupCauseCode)} is empty

SIP_HEADER() gives you only access to headers of the initial INVITE request.

This leads me to a question: Is 
X-Asterisk-HangupCause/X-Asterisk-HangupCauseCode only set by Asterisk, 
or is it also parsed on incoming messages?

regards
Klaus



More information about the asterisk-dev mailing list