[sr-dev] git:master: modules_k/nathelper: add_contact_alias adds <> s around contact URI

Alex Hermann alex at speakup.nl
Tue Sep 6 14:22:39 CEST 2011


On Tuesday 06 September 2011, Klaus Darilion wrote:
> Am 06.09.2011 12:19, schrieb Alex Hermann:
> > On Tuesday 06 September 2011, Alex Hermann wrote:
> >> There seems to be another issue, sorry for the noise.
> > 
> > Or not...
> > 
> > When the contact has no <>, these are added by the add_contact_alias()
> > function, but as header parameters instead of uri paramater. My attempted
> > fix doesn't work either.
> > 
> > I think the problem is with the lumps. When the <> are missing, 3 lumps
> > are added to the contact: "<", ">" and ";alias=X" parameter, which seems
> > to mess up the position of the alias parameter. This looks like the
> > infamous problem that one can't manipulate the same part of the message
> > multiple times.
> 
> Maybe you can workaround it by adding just 2 lumps? E.g. "<" and
> ";alias=X>".

That might work. Just have to make sure that existing parameters in the contact 
without <> have to be moved outside the > because they are header parameters
(according to rfc3261 section 20, last paragraph).

If i understood correctly the following cases must be supported:

These go wrong at the moment:

Contact: sip:192.168.1.10:5678
should become
Contact: <sip:192.168.1.10:5678;alias=X>

Contact: sip:192.168.1.10:5678;header-param
should become
Contact: <sip:192.168.1.10:5678;alias=X>header-param


These are already correctly supported:

Contact: <sip:192.168.1.10:5678>
should become
Contact: <sip:192.168.1.10:5678;alias=X>

Contact: <sip:192.168.1.10:5678;uri-param>
should become
Contact: <sip:192.168.1.10:5678;alias=X;uri-param>

Contact: <sip:192.168.1.10:5678>;header-param
should become
Contact: <sip:192.168.1.10:5678;alias=X>header-param

Contact: <sip:192.168.1.10:5678;uri-param>;header-param
should become
Contact: <sip:192.168.1.10:5678;alias=X;uri-param>header-param

-- 
Greetings,

Alex Hermann




More information about the sr-dev mailing list