[SIP Beyond VoIP] Address through SylkServer
Saúl Ibarra Corretgé
saul at ag-projects.com
Wed Aug 29 09:42:52 CEST 2012
Hi,
On Aug 28, 2012, at 4:56 PM, Hadzhiev, Tihomir wrote:
> Hi Saul,
>
> Thanks for the tip, but I can't really understand ( not trying to play fool of course :) ) your suggestions.
>
> The expected string towards the XMPP server would be:
>
> -739277318\40chat.facebook.com at facebook.testing.com
>
> And If I use the @ sign instead of the \40 Sylk will catch the URL @chat.facebook.com, without the rest ( @facebook.testing.com ).
>
> And I could get the following sentence:
>
> You need to percent encode the URI so that it looks like a correct SIP URI
>
> I tried to percent the "\" only as the 40 is needed as a string, as well as the "\".
>
> So could you please suggest if that's possible at all how the full URI would look like ? a real example would really suffice :)
All those numbers confused me, this is just JID escaping as per XEP-0106. You need to replace the '@' sign with a '\40', but in order to add the '\' character to a Python string you need to escape it, so you'll need to replace '@' with '\\40'.
Now, the resulting URI is not a valid SIP URI, so I suggest you do the following:
- Percent-encode the URI on the SIP side, that is: sip:-739277318%40chat.facebook.com at facebook.testing.com
- Fix the URI to be a valid escaped JID:
s = "-739277318%40chat.facebook.com at facebook.testing.com"
valid_jid = s.replace('%40', '\\40')
Regards,
--
Saúl Ibarra Corretgé
AG Projects
More information about the SIPBeyondVoIP
mailing list