doyke / p2p-sip

Automatically exported from code.google.com/p/p2p-sip
0 stars 0 forks source link

Patch: Allow "~" in SIP header token #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
P2P-SIP doesn't allow "~" character for tokens in headers, so it sends quoted 
strings (see To tag):

ACK sip:7708@192.168.201.12 SIP/2.0
Content-Length: 0
Via: SIP/2.0/UDP 
192.168.201.21:52258;rport;branch=z9hG4bKnfnrdQTbSyyhBXysTrZV_w..
From: "aaa" <sip:aaa@192.168.201.12>;tag=131719064258
To: 
<sip:7708@192.168.201.12>;tag="288046~df801cdf-5d89-4a12-ba30-1403941f42b7-19166
831"
CSeq: 1 ACK
Call-ID: c767171e-1478-11e3-b345-902b341f772d@192.168.201.21

Attached patch fixes this.

Original issue reported on code.google.com by hzdb...@gmail.com on 3 Sep 2013 at 9:48

Attachments:

GoogleCodeExporter commented 9 years ago
According to RFC3261:

To        =  ( "To" / "t" ) HCOLON ( name-addr
             / addr-spec ) *( SEMI to-param )
to-param  =  tag-param / generic-param
tag-param =  "tag" EQUAL token
token     =  1*(alphanum / "-" / "." / "!" / "%" / "*"
             / "_" / "+" / "`" / "'" / "~" )

Original comment by hzdb...@gmail.com on 24 Jul 2014 at 4:29