[asterisk-dev] [Code Review] chan_sip: Make the session-timers 'require: timer' header an option

Nick Lewis Nick.Lewis at atltelecom.com
Thu Jun 10 03:38:39 CDT 2010



> On 2010-06-09 10:32:46, David Vossel wrote:
> > I should start out by saying I don't know much about session timers or how they are used, this is all based on what I read in sip.conf.sample.
> > 
> > It seems to me that the "timer" in the Require field should only be present when the "session-timers" option is set to originate, because that is the only time we actually require it for the transaction (At least I think this is true?!) .  In the other cases session timers appear to either be only initiated by the other endpoint (which means we should put them in the supported field only) or completely rejected.  To me basing the logic off these options (if that is possible) makes more sense than introducing a new one.
> 
> Nick Lewis wrote:
>     Is there a difference between not originating st, originating st if other party supports it and only allowing a dialog if the other party supports st? Does linking the require-header to the st-mode prevent the middle option?
> 
> David Vossel wrote:
>     Do we even have logic in place to do that middle option now (the one were we only originate it if the other side supports it)?  I don't think linking the require-header to the st-mode would prevent the middle option, because I'm not sure that option exists yet.  I'm guessing that option would end up being something like "session-timers=originate_when_supported" or something.  Maybe I'm wrong though, I'm not very confident in my session-timer logic knowledge.

I think the modes and behaviour could be as follows:
refuse: for outgoing calls do not add to supported-header; 
        for incoming calls do not add to supported-header even if received with required-header
accept: for outgoing calls do not add to supported-header but retry with it added to supported-header if a required-header rejection is received;
        for incoming calls add to supported-header if received with supported-header
(new)originate: for outgoing calls add to supported-header but not required-header;
                for incoming calls add to supported-header if received with supported-header
require(oldorig): for outgoing calls add to supported-header and required-header; 
                   for incoming calls add to supported-header and required-header even if not received with supported-header

If originate cannot be renamed for backward compatibility then the last two could be negotiate and originate


- Nick


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/698/#review2184
-----------------------------------------------------------


On 2010-06-09 10:36:35, Darren Sessions wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/698/
> -----------------------------------------------------------
> 
> (Updated 2010-06-09 10:36:35)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> I've had several issues with the 'Require: timer' header option with regards to the session timers where vendors (primarily BT) and customers SBCs do not support this header and they reject calls with a '420 Bad Extension'.
> 
> Simply commenting this code out in chan_sip.c in the past has resolved the problem, however, I'm interested in a possibly more permanent solution. From what I can gather, this field is optional anyways (someone correct me if I'm wrong here). I've included an excerpt from RFC4028 (section 8.1) which seems to say that it's even not recommended.
> 
> Either way, this patch defaults the require timers option to true so as to be consistent with the existing default behavior. I've also included changes to the configs/sip.conf.sample.
> 
> 
> From RFC4028:
> 
>    The proxy MUST remember, for the duration of the transaction, whether
>    the request contained the Supported header field with the value
>    'timer'.  If the request did not contain a Supported header field
>    with the value 'timer', the proxy *MAY* insert a Require header field
>    with the value 'timer' into the request.  However, this is *NOT
>    RECOMMENDED*.  This allows the proxy to insist on a session timer for
>    the session.  This header field is not needed if a Supported header
>    field was in the request; in this case, the proxy would already be
>    sure the session timer can be used for the session.
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_sip.c 269269 
>   /trunk/configs/sip.conf.sample 269269 
> 
> Diff: https://reviewboard.asterisk.org/r/698/diff
> 
> 
> Testing
> -------
> 
> Compile
> 
> 
> Thanks,
> 
> Darren
> 
>




More information about the asterisk-dev mailing list