[reSIProcate] Embedded headers in a SIP Uri

Scott Godin slgodin at icescape.com
Wed May 21 15:38:37 CDT 2008


Line 850 is currently this:

  pb.skipToOneOf(Symbols::RA_QUOTE, Symbols::SEMI_COLON);

And is used to move from the ? to end of the URI.  If we change this to
just:

     pb.skipToOneOf(ParseBuffer::Whitespace);

and the URI is contained in angle brackets (ie. NameAddr), then the > will
end up at the end of the mEmbeddedHeadersText.

I think the following would be better:

   pb.skipToOneOf(Symbols::RA_QUOTE, ParseBuffer::Whitespace);

 

I have no idea why the SEMI_COLON condition was there - does anyone know?

 

I've added some more asserts to your new test in testSipMessage.cxx to try
and exercise this, but I haven't test it.

 

Scott

 

 

 

From: resiprocate-devel-bounces at resiprocate.org
[mailto:resiprocate-devel-bounces at resiprocate.org] On Behalf Of Jeremy Geras
Sent: May 21, 2008 3:40 PM
To: resiprocate-devel at resiprocate.org
Subject: [reSIProcate] Embedded headers in a SIP Uri

 

There's an exception when the INVITE below is parsed (using the latest
code).  It looks like a bug in the parsing of embedded headers in a Uri
(shows up when the Request-Line is parsed).  My reading of 3261 is that
"headers" in the following won't ever contain a space (unless it's escaped):

SIP-URI          =  "sip:" [ userinfo ] hostport
                    uri-parameters [ headers ]

So I think Uri.cxx:850 should be changed to the following:

pb.skipToOneOf(ParseBuffer::Whitespace);

I've updated resip/stack/test/testSipMessage.cxx with a test case for this.
I'll check in my fix to Uri.cxx if someone can confirm that it looks good.

Thanks,
Jeremy


---------------------------------

INVITE sip:7003 at 192.122.24.94:20060?REQUIRE=replaces SIP/2.0
Via: SIP/2.0/UDP 192.122.24.109;branch=z9hG4bKfc4a20db5EC58FB8
From: "7006 601" <sip:7006 at scsuk.europe.nortel.com>;tag=29C49D21-D9FDBDBC
To: <sip:7003 at 192.122.24.94:20060?REQUIRE=replaces>
CSeq: 1 INVITE
Call-ID: a9ad18fd-5fd391bf-309febea at 192.122.24.109
Contact: <sip:7006 at 192.122.24.109>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY,
PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_601-UA/2.1.1.0052
Supported: 100rel,replaces
Allow-Events: talk,hold,conference
Replaces:
MDQ5MDJmZGEyYTkyNTBhZjBhNDg0NjUyMzE1MTc2Mjk.;to-tag=cf71d002;from-tag=139493
0945
Referred-By: <sip:7776 at scsuk.europe.nortel.com>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 253

v=0
o=- 1210601497 1210601497 IN IP4 192.122.24.109
s=Polycom IP Phone
c=IN IP4 192.122.24.109
t=0 0
m=audio 2224 RTP/AVP 0 8 18 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000



Jeremy Geras
Software Developer
CounterPath Corporation

T  604.320.3344 x1373
F  250.380.0404


This email may be privileged and/or confidential, and the sender does not
waive any related rights and obligations. Any distribution, use or copying
of this email or the information it contains by other than an intended
recipient is unauthorized. If you receive this email in error, please notify
me immediately and delete the contents and any attachments.

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel at resiprocate.org
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20080521/bac802f1/attachment.htm>


More information about the resiprocate-devel mailing list