rfc compliant sip option parsing + new unit test
authorDavid Vossel <dvossel@digium.com>
Mon, 28 Jun 2010 18:38:47 +0000 (18:38 +0000)
committerDavid Vossel <dvossel@digium.com>
Mon, 28 Jun 2010 18:38:47 +0000 (18:38 +0000)
commit8a07dbf95ddcf1dc2bda06fd82a58a26866493df
tree2c6d4a9d05f24a0925c629ac851823ef159bd598
parentdc877759cba8b295c50fa05d256bf62d793c7a5e
rfc compliant sip option parsing + new unit test

RFC 3261 section 8.2.2.3 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.

Review: https://reviewboard.asterisk.org/r/680/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c
channels/sip/include/reqresp_parser.h
channels/sip/include/sip.h
channels/sip/reqresp_parser.c