[asterisk-dev] [Code Review]: Manage translation table between SIP and ISDN hangup causes
Olle E Johansson
reviewboard at asterisk.org
Thu Dec 6 08:09:48 CST 2012
> On Dec. 6, 2012, 7:22 a.m., Birger Harzenetter wrote:
> > I see a number of issues here.
> >
> > In my experience the numeric SIP response is not always unique.
> > You may have to check the text as well to find out what exactly happened.
> >
> > I think it would be a lot easier to use numeric cause codes as well.
> > Otherwise you need to document all the names as well.
> > (Are there names for all possible causes?)
> >
> > (this is a core thing only related to this work)
> > There's some ambiguity on the cause side as well as we don't have the location data available.
> > I think that should be added to give this effort more meaning.
> > Some causes can mean quite different things depending on where they come from.
> > Likewise the sensible way to handle the situation can also vary depending on the location.
> >
> > There are some translations that don't make sense to me.
> > RFC 3398 isn't the best reference I think (rejected > forbidden or out of order > bad gateway, what gateway?)
> > But I'll leave that for later.
> >
Please read the code again, Birger. The code works exactly like before, with the same mappings. If we're going to change that, it's a different patch and review. We follow the RFCs and when they don't cover it, I used to copy Cisco documentation.
The translation is ONLY based on numeric cause codes, both ways.
Thanks for your feedback.
/O
- Olle E
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2227/#review7492
-----------------------------------------------------------
On Dec. 5, 2012, 5:34 a.m., Olle E Johansson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2227/
> -----------------------------------------------------------
>
> (Updated Dec. 5, 2012, 5:34 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> 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
>
>
> This addresses bug ASTERISK-20759.
> https://issues.asterisk.org/jira/browse/ASTERISK-20759
>
>
> Diffs
> -----
>
> /trunk/channels/chan_sip.c 377205
> /trunk/channels/sip/include/sip_utils.h 377205
>
> Diff: https://reviewboard.asterisk.org/r/2227/diff
>
>
> Testing
> -------
>
> 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
>
>
> Thanks,
>
> Olle E
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121206/0afa933e/attachment.htm>
More information about the asterisk-dev
mailing list