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.
Support for Other Channel Drivers
The implementation that HANGUPCAUSE and the modified SIP_CAUSE use is extensible to other channel technologies as well. Work to support these other channel technologies is in progress.
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 one channel technology to another. This work is also in progress.