[pjsip] Bug + patch: The '@' in the 'Replaces=' (REFER) must be escaped [RFC-3515]

Eize Slange eize.slange at gmail.com
Tue Feb 11 04:41:43 EST 2014


Hello all,

Recently with a particular SIP-PBX we ran into a transfer issue.
It turned out that the "Refer-To"-parameter in the REFER message was
incorrect.

PJSIP was using: (note the '@' in the call-ID in the Replaces=)
---------------------------------------------------------------
Refer-To: <sip:7001 at mysterymachine.lab?Require=replaces&Replaces=
d211351c-94f4-4661-a9dea552c3b17b79 at 192.168.71.10
%3Bto-tag%3Dbf8355e9-5ae7-4226-8c467f07f3e589cc%3Bfrom-tag%3Dc69bb8230a6542ee9b3d2c2ed0fa9b4b>

RFC-3515 gives us next examples (see 3rd example)
-------------------------------------------------
Refer-To: sip:alice at atlanta.example.com
Refer-To: <
sip:bob at biloxi.example.net?Accept-Contact=sip:bobsdesk.biloxi.example.net&Call-ID%3D55432%40alicepc.atlanta.example.com
>
Refer-To: <
sip:dave at denver.example.org?Replaces=12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994
>
Refer-To: <sip:carol at cleveland.example.org;method=SUBSCRIBE>
Refer-To: http://www.ietf.org

As can be observed, the '@' is escaped in above example.

I've attached the diff-patch against the trunk (but can also applied
unmodified into 1.x branch).
While PJSIP has some standard escaping routines (pj_strncpy_escape), I
found it introducing too much complexity in that particular code. So I just
do a simple buffer-copy while replacing the '@' when found.

With regards,
Eize Slange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140211/c312bf94/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pjsua_call.c.patch
Type: application/octet-stream
Size: 1580 bytes
Desc: not available
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140211/c312bf94/attachment-0001.patch>


More information about the pjsip mailing list