presentity with ampersand in the uri

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

presentity with ampersand in the uri

Sigrid Thijs
Hi,

we're using OpenSIPS version 1.4.2 with the presence module, and we have
a problem when the presentity uri in the presence description contains
an ampersand (&).
The presence description that is stored in the presentity table looks
like this:

<presence
   xmlns="urn:ietf:params:xml:ns:pidf"
   xmlns:ep="urn:ietf:params:xml:ns:pidf:status:rpid-status"
   xmlns:et="urn:ietf:params:xml:ns:pidf:rpid-tuple"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   entity="sip:b&w_1228920594$[hidden email]">
   <tuple id="2963593521">
     <status>
       <basic>open</basic>
     </status>
   </tuple>
</presence>

When opensips tries to send a NOTIFY with this presence description, the
following error occurs:

Dec 10 16:29:09 [17215] DBG:presence_xml:pres_agg_nbody:
[user]=b&w_1228920594$comm.net  [domain]= mydomain.com
Entity: line 7: parser error : EntityRef: expecting ';'
   entity="sip:b&w_1228920594$[hidden email]">
                             ^
Dec 10 16:29:09 [17215] ERROR:presence_xml:agregate_xmls: while parsing
xml body message
Dec 10 16:29:09 [17215] ERROR:presence_xml:pres_agg_nbody: while
aggregating body
Dec 10 16:29:09 [17215] DBG:presence:send_notify_request: Could not get
the notify_body

It seems there is trouble with the '$' character, but when the
presentity uri is something like 'foo_1228923243$[hidden email]'
this problem does not occur (and the NOTIFY requests contain the
presence  description). It only happens when there is an ampersand (&)
in the presentity uri.

kind regards,

Sigrid

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: presentity with ampersand in the uri

Klaus Darilion
Probably & is a special character in XML and needs to be escaped:

&amp;

Verify if the unescaped & is sent by the client, or is created inside the
SIP proxy during XML processing.

regards
klaus


> Hi,
>
> we're using OpenSIPS version 1.4.2 with the presence module, and we have
> a problem when the presentity uri in the presence description contains
> an ampersand (&).
> The presence description that is stored in the presentity table looks
> like this:
>
> <presence
>    xmlns="urn:ietf:params:xml:ns:pidf"
>    xmlns:ep="urn:ietf:params:xml:ns:pidf:status:rpid-status"
>    xmlns:et="urn:ietf:params:xml:ns:pidf:rpid-tuple"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    entity="sip:b&w_1228920594$[hidden email]">
>    <tuple id="2963593521">
>      <status>
>        <basic>open</basic>
>      </status>
>    </tuple>
> </presence>
>
> When opensips tries to send a NOTIFY with this presence description, the
> following error occurs:
>
> Dec 10 16:29:09 [17215] DBG:presence_xml:pres_agg_nbody:
> [user]=b&w_1228920594$comm.net  [domain]= mydomain.com
> Entity: line 7: parser error : EntityRef: expecting ';'
>    entity="sip:b&w_1228920594$[hidden email]">
>                              ^
> Dec 10 16:29:09 [17215] ERROR:presence_xml:agregate_xmls: while parsing
> xml body message
> Dec 10 16:29:09 [17215] ERROR:presence_xml:pres_agg_nbody: while
> aggregating body
> Dec 10 16:29:09 [17215] DBG:presence:send_notify_request: Could not get
> the notify_body
>
> It seems there is trouble with the '$' character, but when the
> presentity uri is something like 'foo_1228923243$[hidden email]'
> this problem does not occur (and the NOTIFY requests contain the
> presence  description). It only happens when there is an ampersand (&)
> in the presentity uri.
>
> kind regards,
>
> Sigrid
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: presentity with ampersand in the uri

Sigrid Thijs
You are right, the client did not escape the ampersand.

Thanks,
Sigrid

Klaus Darilion wrote:

> Probably & is a special character in XML and needs to be escaped:
>
> &amp;
>
> Verify if the unescaped & is sent by the client, or is created inside the
> SIP proxy during XML processing.
>
> regards
> klaus
>
>
>> Hi,
>>
>> we're using OpenSIPS version 1.4.2 with the presence module, and we have
>> a problem when the presentity uri in the presence description contains
>> an ampersand (&).
>> The presence description that is stored in the presentity table looks
>> like this:
>>
>> <presence
>>    xmlns="urn:ietf:params:xml:ns:pidf"
>>    xmlns:ep="urn:ietf:params:xml:ns:pidf:status:rpid-status"
>>    xmlns:et="urn:ietf:params:xml:ns:pidf:rpid-tuple"
>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>    entity="sip:b&w_1228920594$[hidden email]">
>>    <tuple id="2963593521">
>>      <status>
>>        <basic>open</basic>
>>      </status>
>>    </tuple>
>> </presence>
>>
>> When opensips tries to send a NOTIFY with this presence description, the
>> following error occurs:
>>
>> Dec 10 16:29:09 [17215] DBG:presence_xml:pres_agg_nbody:
>> [user]=b&w_1228920594$comm.net  [domain]= mydomain.com
>> Entity: line 7: parser error : EntityRef: expecting ';'
>>    entity="sip:b&w_1228920594$[hidden email]">
>>                              ^
>> Dec 10 16:29:09 [17215] ERROR:presence_xml:agregate_xmls: while parsing
>> xml body message
>> Dec 10 16:29:09 [17215] ERROR:presence_xml:pres_agg_nbody: while
>> aggregating body
>> Dec 10 16:29:09 [17215] DBG:presence:send_notify_request: Could not get
>> the notify_body
>>
>> It seems there is trouble with the '$' character, but when the
>> presentity uri is something like 'foo_1228923243$[hidden email]'
>> this problem does not occur (and the NOTIFY requests contain the
>> presence  description). It only happens when there is an ampersand (&)
>> in the presentity uri.
>>
>> kind regards,
>>
>> Sigrid
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
>



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users