The PRI_CAUSE variable – notifying PRI lines of hangup cause before hangup
Available since Asterisk release 1.0
Starting with Asterisk 1.2 HangUp accepts cause codes as argument; this is the preferred method compared to setting the variable PRI_CAUSE.
On Zap PRI channels, chan_capi and chan_misdn BRI channels, it is possible to set the PRI_CAUSE variable prior to Hangup(). This will send a PRI DISCONNECT message with the set CAUSE element to the switch. Some commonly used cause codes:
16 = Normal call clearing
17 = User busy
18 = No user responding (telephone device not connected)
21 = Call rejected
22 = Number changed
27 = Destignation out of order
38 = Network out of order
41 = Temporary failure
PRI_CAUSE – Pre-recorded message delivered from telco switch.
1 – The number you have reached is not in service, this is a recording.
2 – Fast Busy Signal
17 – Slow Busy Signal (Normal busy signal)
28 – We’re sorry your call cannot be completed as dialed
1 – “The number you have dialled has not been recognised. Please check and try again.”
2 – Number unobtainable tone
17 – Engaged tone
18 – Number unobtainable tone
21 – Number unobtainable tone
22 – “The number you have dialled has not been recognised. Please check and try again.”
27 – “This number is temporarily out of order. We are sorry for any inconvenience.”
28 – Number unobtainable tone
38 – “This number is temporarily out of order. We are sorry for any inconvenience.”
41 – “This number is temporarily out of order. We are sorry for any inconvenience.”
^
Example
exten => i,1,SetVar(PRI_CAUSE=1)
; invalid extension dialed – PRI_CAUSE=unallocated number
exten => i,2,Hangup
; send the DISCONNECT message
; This will in most cases result in a network generated recording like
“The number you have dialed has been disconnected …”
See also
- Reading the dialplan variable Asterisk variable hangupcause
- Dialplan variable DIALSTATUS
- Asterisk variables: Variables overview
- Asterisk cmd Hangup
- Asterisk cmd Progress: Progress indication (prepare to play early audio without answering)
- Asterisk variables
- Asterisk ZAP channels: Zaptel is the ISDN PRI connection in Asterisk
- ISDN, PRI
Go back to Asteriskf