[SIP Beyond VoIP] Address through SylkServer

Hadzhiev, Tihomir tihomir.hadzhiev at acision.com
Tue Aug 28 16:56:51 CEST 2012


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 :)

Thanks,
Tiho



-----Original Message-----
From: Saúl Ibarra Corretgé [mailto:saul at ag-projects.com]
Sent: Tuesday, August 28, 2012 4:37 PM
To: Hadzhiev, Tihomir
Cc: sipbeyondvoip at lists.ag-projects.com
Subject: Re: [SIP Beyond VoIP] Address through SylkServer

Hi,

On Aug 28, 2012, at 4:16 PM, Hadzhiev, Tihomir wrote:

> Hi All,
>
> I think I have mostly solved my problems with the session establishments, at least from the SIP/MSRP direction towards the XMPP server. And basically you guys were right that the client I'm using is not sending the invites correctly. I will have to deal a bit later with that, together with the XMPP -> MSRP sessions.
>
> However I have another problem now.
>
> I'm trying to make the following message flow: SIP/MSRP -> SYLK -> XMPP Server -> XMPP Backend for Facebook -> Facebook. That's almost possible to be done, but the main problem I'm having is when I want to address message towards FaceBook user.
>
> Currently facebook users appear in XMPP world if a backend is used the following way ( and we know they do not support federation )
>
> -739277318\40chat.facebook.com at facebook.testing.com
>
> What I'm having as a problem of course is the address and particularly the "\" char over there. Do you have idea how the backslash should be represented correctly? As when I enter it as a escape character, Sylk Server complains about the SIP addressing:
>
> I'm entering the address the following way:
>
> -739277318%5C40chat.facebook.com at facebook.testing.com
>
>
>
> Then Sylk complains with the following errors:
>
>
>
> [xmppgateway] New incoming SIP MESSAGE from sip:alice at open-ims.test
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 766, in runUntilCurrent
>
>     f(*a, **kw)
>
>   File "/usr/local/lib/python2.7/dist-packages/sylk/applications/__init__.py", line 137, in handle_notification
>
>     handler(notification)
>
>   File "/usr/local/lib/python2.7/dist-packages/sylk/applications/__init__.py", line 196, in _NH_SIPIncomingRequestGotRequest
>
>     app.incoming_sip_message(request, notification.data)
>
>   File "/usr/local/lib/python2.7/dist-packages/sylk/applications/xmppgateway/__init__.py", line 172, in incoming_sip_message
>
>     recipient = Identity(FrozenURI.parse(to_uri))
>
>   File "/usr/local/lib/python2.7/dist-packages/sylk/applications/xmppgateway/datatypes.py", line 62, in parse
>
>     raise ValueError('invalid SIP uri: %s' % value)
>
> ValueError: invalid SIP uri: sip:-739277318\40chat.facebook.com at facebook.testing.com
>
>
> And at the end basically in the Sylk  ( started with -no-fork ) the Value Error represents the address which I want to see sent towards the XMPP server
>

You need to percent encode the URI so that it looks like a correct SIP URI. Here is a quick example you can try:

In [13]: s = "sip:-739277318\40chat.facebook.com at facebook.testing.com"

In [14]: s1 = urllib2.quote(s, safe='@:')

In [15]: SIPURI.parse(s)
---------------------------------------------------------------------------
SIPCoreError                              Traceback (most recent call last)
<ipython-input-15-cc9392456ecc> in <module>()
----> 1 SIPURI.parse(s)

/Users/saghul/work/ag-projects/python-sipsimple/sipsimple/core/_core.so in sipsimple.core._core.SIPURI_parse (sipsimple/core/_core.c:60045)()

SIPCoreError: Not a valid SIP URI: sip:-739277318 chat.facebook.com at facebook.testing.com

In [16]: SIPURI.parse(s1)
Out[16]: SIPURI('facebook.testing.com', '-739277318 chat.facebook.com', None, None, False, {}, {})

In [17]:


Regards,

--
Saúl Ibarra Corretgé
AG Projects





This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.




More information about the SIPBeyondVoIP mailing list