Upgrade 3CX to v18 and get it hosted free!

Asterisk variable PRI_CAUSE

Author image

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:

1 = Unallocated number
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
In Canada, through Group Telecom (May work through others) The hangup with PRI_CAUSE delivers these messages.

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

In the UK, using a BT ISDN 2e/30e line, setting the PRI_CAUSE code delivers the following messages. Note that there is approximately an 8 second delay before these messages/tones are played to the caller after the Asterisk hangup. If the caller is using a BT analogue line there is a line reversal at the caller’s side of the connection between the 8 second delay and the start of the tone/message. (NB This is not an exhaustive list.). If you are using ZapHFC with a Business/Home Highway box, you will need to use the ‘Progress()’ application before the ‘Hangup’ application to make this work. I’ll do some more testing to see whether this is the case with ZapHFC and ISDN2 as well.

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


Go back to Asteriskf


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.