Discussion:
[asterisk-dev] resending cause codes
marek cervenka
2010-11-30 09:21:27 UTC
Permalink
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

thanks
--
---------------------------------------
Marek Cervenka
=======================================
Klaus Darilion
2010-11-30 09:57:01 UTC
Permalink
Post by 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)
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
Olle E. Johansson
2010-11-30 14:35:10 UTC
Permalink
Post by Klaus Darilion
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?
Not today.. We just translate the SIP code to hangup cause.

/O
Bruce McAlister
2010-11-30 13:40:59 UTC
Permalink
I've not tried what you are trying to do, but, should

exten => _X.,1,Dial(SIP/AsteriskA,${EXTEN})

not be

exten => _X.,1,Dial(SIP/AsteriskA/${EXTEN})



-----Original Message-----
From: asterisk-dev-***@lists.digium.com [mailto:asterisk-dev-***@lists.digium.com] On Behalf Of marek cervenka
Sent: 30 November 2010 09:21
To: asterisk-***@lists.digium.com
Subject: [asterisk-dev] resending cause codes

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

thanks

--
---------------------------------------
Marek Cervenka
=======================================

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/a
Olle E. Johansson
2010-11-30 14:34:05 UTC
Permalink
Post by Bruce McAlister
I've not tried what you are trying to do, but, should
exten => _X.,1,Dial(SIP/AsteriskA,${EXTEN})
not be
exten => _X.,1,Dial(SIP/AsteriskA/${EXTEN})
-----Original Message-----
Sent: 30 November 2010 09:21
Subject: [asterisk-dev] resending cause codes
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)
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.

SIP_HEADER only works for the initial INVITE, not for any headers in any other SIP messages.

/O
marek cervenka
2010-11-30 14:54:51 UTC
Permalink
Post by Olle E. Johansson
Post by marek cervenka
i'm testing sending ISDN cause codes to customer pbx (below example
scenario for unallocated number)
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

am i correct?
--
---------------------------------------
Marek Cervenka
=======================================
Tilghman Lesher
2010-11-30 18:11:28 UTC
Permalink
Post by marek cervenka
Post by Olle E. Johansson
Post by marek cervenka
i'm testing sending ISDN cause codes to customer pbx (below example
scenario for unallocated number)
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
Continue reading on narkive:
Loading...