Review Board 1.7.16


Manage translation table between SIP and ISDN hangup causes

Review Request #2227 - Created Dec. 3, 2012 and updated

Olle E Johansson
trunk
ASTERISK-20759
Reviewers
asterisk-dev
Asterisk
The SIP2CAUSE hangup code conversion tables has up to now been hard-coded in Asterisk. In some cases, like when building in-house ISDN/Q.SIG to SIP gateways, there's a need to manipulate this conversion. 

With this code, advanced users can add a "private" conversion. This is added in front of the built-in conversions.

Asterisk conversion tables does not change in this patch. Everything should work as before. To shrink the chan_sip.c file a small bit I decided to move this functionality into a new source code file.

Adding:
- new source code file sip2cause.c and include file sip2cause.h
- new configuration file sip2cause.conf

Reviewboard doesn't seem accept the new files, so they have to be found in the branch itself.

http://svn.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk

The new files are:
* http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/configs/sip2cause.conf.sample
* http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c
* http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/include/sip2cause.h


2014-04: A new version will be coming soon with a new function - custom hangupcauses outside of the ISDN range (as discussed on asterisk-dev a while ago).
Tested all kinds of weird translations. This file should cause some errors (AST_CAUSE_SKREP doesn't exist, 903 is not a valid SIP reason code etc etc. 

[sip2cause]
604 => AST_CAUSE_SKREP
404 => UNALLOCATED
599 Bad => USER_BUSY
486 => NORMAL_CLEARING
603 => UNALLOCATED
        
[cause2sip]
SKREP => 503 Service Failure
UNALLOCATED => 903 Go to hell
UNALLOCATED => 499 I don't want to do that.
USER_BUSY => 503 I am not feeling well
Review request changed
Updated (April 11, 2014, 9:57 a.m.)
  • The SIP2CAUSE hangup code conversion tables has up to now been hard-coded in Asterisk. In some cases, like when building in-house ISDN/Q.SIG to SIP gateways, there's a need to manipulate this conversion. 
    
    With this code, advanced users can add a "private" conversion. This is added in front of the built-in conversions.
    
    Asterisk conversion tables does not change in this patch. Everything should work as before. To shrink the chan_sip.c file a small bit I decided to move this functionality into a new source code file.
    
    Adding:
    - new source code file sip2cause.c and include file sip2cause.h
    - new configuration file sip2cause.conf
    
    Reviewboard doesn't seem accept the new files, so they have to be found in the branch itself.
    
    http://svn.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk
    
    The new files are:
    * http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/configs/sip2cause.conf.sample
    * http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c
    * http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/include/sip2cause.h
    
    
    

    The SIP2CAUSE hangup code conversion tables has up to now been hard-coded in Asterisk. In some cases, like when building in-house ISDN/Q.SIG to SIP gateways, there's a need to manipulate this conversion. 
    
    With this code, advanced users can add a "private" conversion. This is added in front of the built-in conversions.
    
    Asterisk conversion tables does not change in this patch. Everything should work as before. To shrink the chan_sip.c file a small bit I decided to move this functionality into a new source code file.
    
    Adding:
    - new source code file sip2cause.c and include file sip2cause.h
    - new configuration file sip2cause.conf
    
    Reviewboard doesn't seem accept the new files, so they have to be found in the branch itself.
    
    http://svn.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk
    
    The new files are:
    * http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/configs/sip2cause.conf.sample
    * http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/sip2cause.c
    * http://svnview.digium.com/svn/asterisk/team/oej/earl-grey-sip2cause-configurable-trunk/channels/sip/include/sip2cause.h
    
    
    2014-04: A new version will be coming soon with a new function - custom hangupcauses outside of the ISDN range (as discussed on asterisk-dev a while ago).
Adding alert of new version.

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.