This Question is Answered

1 "correct" answer available (5 pts) 2 "helpful" answers available (1 pts)
3 Replies Last post: Jan 11, 2010 1:56 PM by carrick  
Click to view carrick's profile   2 posts since
Dec 31, 2009

Jan 7, 2010 10:11 AM

CR/LF in INVITE message header

OpenSBC seems to be putting in 2 extra CR/LF's in the INVITE message header from one paticular device I am testing. I have compared the Invites from another device I have working and there are three tags that exist from the problem device and not on the other.

Route: <sip:66.63.192.4:5060;lr>
Privacy:none
P-Preferred-Identity:8595067425 <sip:8595067425@66.63.192.4>

Here is the SIP Message that OpenSBC is sending to my softswitch:

INVITE sip:5555555555@192.168.1.4 SIP/2.0
From: 5555555555 <sip:5555555555@10.0.0.4:5060>;tag=3bdf863540e260f
To: 15555555555 <sip:5555555555 @192.168.1.4>
Via: SIP/2.0/UDP 192.168.1.84:5060;iid=2752;branch=z9hG4bKbcb0285302f3de118f8e8ecf72a92d31;uas-addr=192.168.1.4;rport
CSeq: 1512255266 INVITE
Call-ID: 2e17d764bbf031d8c4a07ecfb710fe25@192.168.1.4-0x003c
Contact: <sip:5555555555 @192.168.1.84>
User-Agent: OpenSBC v1.1.6-6
Max-Forwards: 69
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, INFO
Supported: 100rel
Supported: timer
Supported: replaces

X-Remote-Info: sip:10.0.0.100:5058
Content-Type: application/sdp
Content-Length: 227

v=0
o=MxSIP 0 0 IN IP4 192.168.1.4
s=SIP Call
c=IN IP4 192.168.1.84
t=0 0
m=audio 10198 RTP/AVP 0 8 18
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


Is this a configuration problem? A bug with OpenSBC or my device?

Click to view joegen's profile   519 posts since
Apr 28, 2007
1. Jan 7, 2010 11:04 PM in response to: carrick
Re: CR/LF in INVITE message header
This seems like a parser bug. Can you send me a wireshark capture together with the level 5 log?
Click to view joegen's profile   519 posts since
Apr 28, 2007
2. Jan 9, 2010 10:16 PM in response to: joegen
Re: CR/LF in INVITE message header

Hi Rick,

Thanks for the logs and pcap you sent offlist. They were very helpful. I found the bug to be related to the headers your UA is sending. The UA is inserting Privacy and P-Preferred-Identity headers without a WSP after the COLON. This is in violation of the specs although I must admit it should be handled properly by the opensipstack parser. This is now fixed in CVS. Please download the latest opensipstack and retest. Post your results here. I am also pasting the RFC 3261 ABNF rule for HCOLON just in case you want to place a bug report to your UA manufacturer

Offending headers: "Privacy:none" "P-Preferred-Identity:6064443009 <sip:6064443009@xx.xx.xx.xx>"

RFC 3261

{noformat} SIP header field values can be folded onto multiple lines if the
continuation line begins with a space or horizontal tab. All linear
white space, including folding, has the same semantics as SP. A
recipient MAY replace any linear white space with a single SP before
interpreting the field value or forwarding the message downstream.
This is intended to behave exactly as HTTP/1.1 as described in RFC
2616 [8]. The SWS construct is used when linear white space is
optional, generally between tokens and separators.

LWS = [*WSP CRLF] 1*WSP ; linear whitespace
SWS = [LWS] ; sep whitespace

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.

HCOLON = *( SP / HTAB ) ":" SWS
{noformat}