Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

Usage of SIP_CAUSE has been known for a while now to impact performance in some situations due to the use of the MASTER_CHANNEL dialplan function which must scan through the channel list. Another issue with SIP_CAUSE is that it is too technology-specific. The HANGUPCAUSE hash resolves these issues by passing this data via control frames and creating a more generic mechanism that all channel technologies can share. This allows the channel and cause code information to move through Asterisk's core along with other control frames to the parent channel.

Differences in Usage

HANGUPCAUSE may be used in any situation that calls for SIP_CAUSE as a drop-in replacement if only SIP channels are being called. If used with non-SIP channels, dialplan code using HANGUPCAUSE must be able to handle non-SIP cause codes or be able to safely ignore them. SIP_CAUSE has also been modified to use HANGUPCAUSE as its backend to take advantage of better performing code.

Example

Support for Other Channel Drivers

The implementation that HANGUPCAUSE and the modified SIP_CAUSE use is extensible to other channel technologies as well. The implementation for chan_sip, chan_iax2, and chan_dahdi (analog, PRI, SS7, and MFC/R2) is complete and committed.

Understanding the Information Provided

In an effort to allow consumers of this information to better understand what is available, translation facilities will be provided that allow conversion of cause codes from channel-specific terms to Asterisk/ISDN cause codes. This work is in progress.

IAX2

IAX2 already uses Asterisk/ISDN cause codes, so these are provided as-is.

DAHDI

ISDN

Asterisk cause codes are a superset of ISDN cause codes. These are left unmodified.

SS7

Asterisk cause codes are a superset of ISDN cause codes (which SS7 uses). These are left unmodified.

Analog

Analog hangups will always present with AST_CAUSE_NORMAL_CLEARING (Normal Clearing). There is no way to get additional information for these channels.

MFC/R2

The mapping for MFC/R2 cause codes to Asterisk/ISDN cause codes can be found below.

MFC/R2 Cause Code

Asterisk/ISDN Cause Code

OR2_CAUSE_BUSY_NUMBER

AST_CAUSE_BUSY

OR2_CAUSE_NETWORK_CONGESTION

AST_CAUSE_CONGESTION

OR2_CAUSE_OUT_OF_ORDER

AST_CAUSE_DESTINATION_OUT_OF_ORDER

OR2_CAUSE_UNALLOCATED_NUMBER

AST_CAUSE_UNREGISTERED

OR2_CAUSE_NO_ANSWER

AST_CAUSE_NO_ANSWER

OR2_CAUSE_NORMAL_CLEARING

AST_CAUSE_NORMAL_CLEARING

OR2_CAUSE_UNSPECIFIED

AST_CAUSE_NOTDEFINED

SIP

The cause code translations for SIP are based in part on RFC3398. They can be found in the table below.

SIP Response

Asterisk/ISDN Cause Code

401

AST_CAUSE_CALL_REJECTED

403

AST_CAUSE_CALL_REJECTED

404

AST_CAUSE_UNALLOCATED

407

AST_CAUSE_CALL_REJECTED

408

AST_CAUSE_NO_USER_RESPONSE

409

AST_CAUSE_NORMAL_TEMPORARY_FAILURE

410

AST_CAUSE_NUMBER_CHANGED

420

AST_CAUSE_NO_ROUTE_DESTINATION

480

AST_CAUSE_NO_ANSWER

483

AST_CAUSE_NO_ANSWER

484

AST_CAUSE_INVALID_NUMBER_FORMAT

485

AST_CAUSE_UNALLOCATED

486

AST_CAUSE_BUSY

488

AST_CAUSE_BEARERCAPABILITY_NOTAVAIL

All Other 4xx

AST_CAUSE_INTERWORKING

500

AST_CAUSE_FAILURE

501

AST_CAUSE_FACILITY_REJECTED

502

AST_CAUSE_DESTINATION_OUT_OF_ORDER

504

AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE

505

AST_CAUSE_INTERWORKING

All Other 5xx

AST_CAUSE_CONGESTION

600

AST_CAUSE_USER_BUSY

603

AST_CAUSE_CALL_REJECTED

604

AST_CAUSE_UNALLOCATED

606

AST_CAUSE_BEARERCAPABILITY_NOTAVAIL

All Other 6xx

AST_CAUSE_INTERWORKING

  • No labels