[asterisk-dev] resending cause codes

Tilghman Lesher tlesher at digium.com
Tue Nov 30 12:11:28 CST 2010


On Tuesday 30 November 2010 08:54:51 marek cervenka wrote:
> >> 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
> > 
> > This is indeed not an asterisk-dev question.
> 
> i know :( sorry
> 
> but...asterisk-dev question may be
> 
> how can i implement parsing incoming messages and get
> X-Asterisk-HangupCauseCode?
> 
> and answer may be note from
> http://www.voip-info.org/wiki/view/Asterisk+variable+hangupcause
> 
> Note: Asterisk 1.8 will allow to read SIP response codes in the dialplan
> via {HASH(SIP_CAUSE,<channel-name>)}.
> Asterisk 1.8 also comes with a 'use_q850_reason' configuration option
> for generating and parsing, if available, "Reason: Q.850;cause=<cause
> code>".
> 
> this mean i must implement
> {HASH(ISUP_CAUSE,<channel-name>)} -> parsed from Reason header

Hopefully not.  The only reason we implemented the passing back of the
raw SIP code in the dialplan is that the conversion to cause is lossy.
That is, several SIP status codes all map back to a single ISUP cause code,
and there are legitimate reasons for wanting to know which status code
was received.  What SHOULD happen is that if use_q850_reason is set, then
the cause sent to the core should simply be the cause code in this header,
which you should be able to read in ${HANGUPCAUSE}.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list