[asterisk-dev] [Code Review] rfc compliant sip option parsing + new unit test

David Vossel dvossel at digium.com
Tue Jun 22 16:54:24 CDT 2010

This is an automatically generated e-mail. To reply, visit:

(Updated 2010-06-22 16:54:24.053030)

Review request for Asterisk Developers.


Update reflects Nick's last comment.


RFC 3261 section states that if any unsupported options are found in the Require header field, a "420 (Bad Extension)" response should be sent with an Unsupported header field containing only the unsupported options.

This is not currently being done correctly.  Right now, if Asterisk detects any unsupported sip options in a Require header the entire list of options are returned in the Unsupported header even if some of those options are in fact supported.  This patch fixes that by building an unsupported options character buffer when parsing the options that can be sent with the 420 response.  A unit test verifying this functionality has been created.  Some code refactoring was required.

RFC 3261 section
"  If a UAS does not understand an option-tag listed in a
   Require header field, it MUST respond by generating a response with
   status code 420 (Bad Extension).  The UAS MUST add an Unsupported
   header field, and list in it those options it does not understand
   amongst those in the Require header field of the request."

Diffs (updated)

  /trunk/channels/chan_sip.c 271977 
  /trunk/channels/sip/include/reqresp_parser.h 271976 
  /trunk/channels/sip/include/sip.h 271976 
  /trunk/channels/sip/reqresp_parser.c 271976 

Diff: https://reviewboard.asterisk.org/r/680/diff


unit test passes and verifies expected behavior... test calls were made as well just as a sanity check.



More information about the asterisk-dev mailing list