On 4/17/13 2:20 AM, Sachin Rastogi wrote:
> Hi All,
> As discussed below
>
>> Via:    \r\n
>>          SIP/2.0    \r\n
>>                           /[transport]
> [local_ip]:[local_port];branch=[branch]\r\n
>
> is valid as per ABNF.

Since this has already been discussed in this thread, what is your new 
question here?

> What is the reasoning behind defining CRLF as part of
> HCOLON ?

The reasoning behind including CRLF in HCOLON (and COMMA and several 
others) was to make it reasonably convenient and readable to specify the 
syntax of commands, while including the whitespace where it is permitted.

(IIRC, RFC 2543 - the predecessor to 3261 - did not explicitly include 
the whitespace in the ABNF. It was added in 3261 to make the 
specification more precise and unambiguous, while preserving backward 
compatibility.)

> Why it is allow by rfc 3261 to send someone **via** like above
> with CRLFs ?

Brett already answered this. When work was started on SIP a lot of the 
basics were borrowed from http, and that included whitespace in header 
fields. It has been preserved since for backwards compatibility.

In retrospect it might have been wiser to not do this. But it is far too 
late to change that decision.

> Please share any usecase scenario.

If you insist on a usecase, then examples of messages in documents, for 
people to read, are one. Often the lines (including Via lines) get too 
long to present in a document without breaking them.

Your questions sound like ones from someone whose implementation is 
breaking upon encountering such usage. If so, sorry. It is up to you to 
make your implementation accept such usage. You don't have to *send* 
things with this usage, but you must *accept* them.

        Thanks,
        Paul

> Thanks & Regards,
> Sachin Rastogi
>
>
>
>
>
>
> On Mon, Apr 15, 2013 at 4:36 PM, Brett Tate <[email protected]> wrote:
>
>>> Is the below message correct or not?
>>
>> Yes.  HCOLON and SLASH accommodate the atypical useless line wrapping and
>> tabs of your example.
>>
>>
>>> Via:    \r\n
>>>          SIP/2.0    \r\n
>>>                           /[transport]
>> [local_ip]:[local_port];branch=[branch]\r\n
>>
>> <snip>
>>
>>>  From the above syntax it seems that CRLF is possible
>>> in the above syntax of Via message header after the ":".
>>> Is my understanding correct or is there some error in
>>> understanding the ABNF grammer ?
>>
>> Yes; you are correct as the RFC 3261 ABNF and text indicates.
>>
>>   "To separate the header name from the rest of value, a colon is used,
>>    which, by the above rule, allows whitespace before, but no line
>>    break, and whitespace after, including a linebreak.  The HCOLON
>>    defines this construct."
>>
>>    Via  =  ( "Via" / "v" ) HCOLON via-parm *(COMMA via-parm)
>>    HCOLON  =  *( SP / HTAB ) ":" SWS
>>
>>
>>   _______________________________________________
>> Sip-implementors mailing list
>> [email protected]
>> https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors
>>
> _______________________________________________
> Sip-implementors mailing list
> [email protected]
> https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors
>

_______________________________________________
Sip-implementors mailing list
[email protected]
https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors

Reply via email to