[asterisk-dev] Require header

Olle E. Johansson oej at edvina.net
Thu Nov 1 03:02:46 CDT 2012


Mark,

Look in RFC 3261 for a discussion on the Supported: and the Require header for SIP extension handling. Use vulcan logic: If we should not parse the require header - why bother at all with adding it? ;-)

In SIP, a user agent announces extensions support with the supported header. If the response contains a Require header with one or more of the offered extensions named, the response indicates that the extension will be used for this dialog.

Now, session timers have an extra mode. If there is NO require header in the response, the UAC may still run refreshes, since these are just ordinary in-dialog requests and doesn't hurt communication. In this case the UAC is always the refresher, since the other party does not understand the extension.  This has been the state when any UAC has sent Asterisk offers of session timers - nothing activates, they run Session timers and have not trusted Asterisk to do it, since Asterisk never said it would.

RFC 4208 is clear about this:

It is
   possible that the UAC requested the session timer (and thus included
   a Session-Expires header field in the request) and that there was no
   Require or Session-Expires header field in the 2xx response.  This
   will happen when the UAS doesn't support the session timer extension
   and only the UAC has asked for a session timer (no proxies have
   requested it).  In this case, if the UAC still wishes to use the
   session timer (which is purely for its benefit alone), it has to
   perform them.  To do this, the UAC follows the procedures defined in
   this specification as if the Session-Expires header field were in the
   2xx response, and its value was the same as that in the request, but
   with a refresher parameter of 'uac'.

So if we have a Require-header in the response, we can parse the response headers and potentially let the other side do the refreshes and trust that it happens - since they have expressed an agreement on using the extension. 

If there is no Require header with "timer" in the response, we're all alone and have to decide if we still want to play the session timer game.

I hope this clarifies.

...now I need to update my slides for the SIP Masterclass with the very same explanation. Always good to discuss these matters. :-)

/O


--
* Olle E. Johansson - oej at edvina.net
* Kamailio & SIP Masterclass Miami FL December 2012
* http://edvina.net/training/







More information about the asterisk-dev mailing list