Can one REGISTER request contain multiple To Header Fields and what would be the scenarios?

248 Views Asked by At

Can we have multiple "To" header in any SIP request/response?

1

There are 1 best solutions below

0
AymericM On

In rfc3261, defining SIP, multiple To headers are not allowed.

The interesting part is from Section 7.3 Header Fields

SIP header fields are similar to HTTP header fields in both syntax and semantics. In particular, SIP header fields follow the [H4.2]
definitions of syntax for the message-header and the rules for
extending header fields over multiple lines. However, the latter is
specified in HTTP with implicit whitespace and folding. This
specification conforms to RFC 2234 [10] and uses only explicit
whitespace and folding as an integral part of the grammar.

[H4.2] also specifies that multiple header fields of the same field name whose value is a comma-separated list can be combined into one
header field. That applies to SIP as well, but the specific rule is
different because of the different grammars. Specifically, any SIP
header whose grammar is of the form

  header  =  "header-name" HCOLON header-value *(COMMA header-value)

Because the To header Augmented BNF does not contains COMMA, it means To can only be added once:

To        =  ( "To" / "t" ) HCOLON ( name-addr
             / addr-spec ) *( SEMI to-param )

The full Augmented BNF, which describe the rules, is available in Section 25