[Kamailio-Users] Trying to make Purple Module work

Eric PTAK eric.ptak.fr at gmail.com
Thu Jun 18 17:35:22 CEST 2009


Hi mani,

I'm not sure where to start...

* Copying the the overview in the module doc:
*"Purple module is a multi-protocol instant-messaging gateway module which
use libpurple, the library on bottom of Pidgin (ex-gaim). **This plugin was
wrote in order to proof the concept of gateway between SIP and MSN/Live
networks. **[...] **It's no really adapted to a production environment with
a huge user count but can be used in order to demonstrate the concept or to
use it in SOHO environment."*
**
To be clearer, for the moment, just try it and give your feedback, but do
not hope to have a userfriendly and stable IM federation.

Currently there is mainly two way to have IM&Presence "Federation" :
1) use a multi-protocol client, which will handle all your accounts and will
display all your separate buddylist as a single one and will use the
appropriate protocol for each buddy. Pidgin and Trillian working like this,
but it's not a real federation, cause you still have multiple identities
running on your computer.
2) use a single-protocol client with a gateway. The gateway is then
responsible to connect with all your accounts you given. That's how work
purple+kamailio, gtalk-2-msn bridges, skype... This a real federation
because you have only one identity on your computer.

There is also a third way, which is only acceptable for a sip-xmpp gateway
(like XMPP kamailio's module), because sip and xmpp are both open protocols
with server-to-server communication.

About the externals buddylists :
With the first federation solution, it's implied, cause your client will
handle directly each list.
But with the second, you need a way to propagate the external list to the
client, and more important a way to say the gateway that you're trying to
use another protocol. With skype and gtalk bridge, is quite simple cause the
developpers handle both gateway and client, so they can do what they want.
With purple module is more difficult, cause we want to be able to use any
sip client... Finally the solution sounds to be XCAP and centralized
buddylist filled by the module, but you'll still need a way to say the
gateway which protocol to use, only with the R-URI (with the URI filtering I
mentioned I previous mails).

I hope this informations will help you understand better the problems.
I know purple isn't finished yet, it's a first version, and need a lot of
improvements to be user friendly.


Regards,

Eric.


2009/6/17 mani sivaraman <mani.opensips at gmail.com>

> Thanks for getting back. I'm really confused about how purple module does
> the IM federation. You might have heard of opnefire/spark IM client or other
> IM clients like trillium or Pidgin. All these are im federation clients
> where you give it all your msn, yahoo and gmail user id and paswrd and logs
> in to all thse servers at the same. These IM clients gets the buddy list
> from yahoo, msn and gmail and uses colors or tabs to identify to which
> server belong. Instead of logging to to each im client , now people can
> login to one client and view and chat all buddies.
>
> Now talking about purple module, if I enter all my msn, yahoo and gmail
> user if and password and map this to my sip account using purplemap table in
> mysql, WILL the purple module logs into all my msn, yahoo, and gmail im
> accounts and fetch all the buddy list ? How will the sip client who is
> connected to openser get all this msn, yahoo and gmail buddy list first of
> all ? SHould the sip client add these buddies manually in the sip client (
> say X-Lite ) connected to openser.
>
> I still don't understand how a sip client connected to the openser, be able
> to interact with other msn, yahoo and gmail buddies and send message. I'm
> sorry to ask this basic question, but I don't understand how this works.
>
> I will appreciate your explanation.
>
>
> On Wed, Jun 17, 2009 at 6:53 AM, Eric PTAK <eric.ptak.fr at gmail.com> wrote:
>
>> Hi mani,
>>
>> Looking your log, I see you're trying to contact sip:manivasagam.s*
>> msn.com at kmilo.smithmicro.com as I mentionned to be a possible way to get
>> purple working without mapping non-sip friends. But it requires
>> modifications in the purple_* functions to support it.
>> Then, there is also the usrloc error cause it didn't find such user. You
>> must use a purple_gateway_domain different from your main domain, in order
>> to filter messages to the gateway easyly, priori to other routes.
>>
>> for example (but again the module need mods) :
>>
>> route {
>>     # initial sanity check, loopavoidance & big messages
>>    .....
>>    .....
>>    # retransmission absorbtion
>>     .....    .....
>>
>>    # messages to purple gateway
>>    if ($rd == "purple_gateway_domain") {
>>        route(10);
>>    }
>>
>>    # main route
>>     .....    .....
>>
>>
>> }
>>
>> #purple route
>> route[10] {
>>
>>    #method filtering to call the appropriate purple function
>>
>>
>>
>> }
>>
>> Eric.
>>
>> 2009/6/16 mani sivaraman <mani.opensips at gmail.com>
>>
>> Attached is kamailio debug log while trying to send a MESSAGE to an MSN
>>> contact from my SIP Account. manivasaga.s at msn.com is the MSN account
>>> available on the SIP Buddy list. THe MESSAGE send fails and the server sends
>>> back 202 and then 404.
>>>
>>> THe debug message is attached. Any input is appreciated.
>>>
>>> On Tue, Jun 16, 2009 at 10:00 AM, mani sivaraman <
>>> mani.opensips at gmail.com> wrote:
>>>
>>>> Hi Eric
>>>> Could you please post a working example kamailio.cfg file with the
>>>> example purplemap table contents (remove passwords from it). I guess I'm
>>>> doing some mistake in coding purple_handle_subscribe,
>>>> purple_handle_publish() and purple_send_message. Your help is really
>>>> apppreciated.
>>>>
>>>> What IM Client did you use to test/develop purple ? Is it X-Lite ? I
>>>> would like to try purple with that client first. Please let me know. I want
>>>> to get the first PUB/SUB and MESSAGE working bet SIP and MSN or Gmail or
>>>> yahoo.
>>>>
>>>> Your help is appreciated.
>>>> - Mani
>>>>
>>>>
>>>> On Tue, Jun 16, 2009 at 2:56 AM, Eric PTAK <eric.ptak.fr at gmail.com>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> The PUBLISH has to be processed normally by the Presence
>>>>> Server (eg handle_publish) to get the response.
>>>>> Then, you can also use purple_handle_publish to propagate you status to
>>>>> external protocols.
>>>>> Whenever, you should not get that error regarding the db entry and the
>>>>> publish sip uri...
>>>>> Need more checks...
>>>>>
>>>>> Eric.
>>>>>
>>>>> 2009/6/15 mani sivaraman <mani.opensips at gmail.com>
>>>>>
>>>>>> Hi Eric
>>>>>> I keep getting this error messages when I setup the purplemap table in
>>>>>> mysql and enable purple PUB/SUN processing in openser. I have only one
>>>>>> mapping purplemap table like this. My SIP client is trying to send presence
>>>>>> PUBLISH, but this never gets ACKed by openser server. And I get this error
>>>>>> every time PUB happens "ERROR:purple:find_accounts: result count = 0"
>>>>>>
>>>>>> sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>|
>>>>>> smvasagam2000 at gmail.com | gtalk | xxxx
>>>>>>
>>>>>>
>>>>>> PUBLISH sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>from [
>>>>>> sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>]
>>>>>> to [sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>
>>>>>> ]
>>>>>> Jun 15 14:37:47 [17541] ERROR:purple:find_accounts: result count = 0
>>>>>> SUBSCRIBE sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>from [
>>>>>> sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>]
>>>>>> to [sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>
>>>>>> ]
>>>>>> Jun 15 14:37:47 [17535] INFO:presence:send_notify_request: NOTIFY
>>>>>> sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>via sip:msivaraman at 172.16.1.125:6332;transport=udp
>>>>>> on behalf of sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>for event presence.winfo
>>>>>> SUBSCRIBE sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>from [
>>>>>> sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>]
>>>>>> to [sip:msivaraman at kmilo.smithmicro.com<sip%3Amsivaraman at kmilo.smithmicro.com>
>>>>>> ]
>>>>>> Jun 15 14:37:47 [17541] ERROR:purple:find_accounts: result count = 0
>>>>>>
>>>>>> Your assistance is appreciated.
>>>>>> Thanks
>>>>>> Mani
>>>>>>
>>>>>>
>>>>>> On Mon, Jun 15, 2009 at 11:13 AM, mani sivaraman <
>>>>>> mani.opensips at gmail.com> wrote:
>>>>>>
>>>>>>> That was it. I did that first time and then I forgot to set the env
>>>>>>> variable again. I will add it to ctl script now. Thanks for your help. I
>>>>>>> appreciate it. I will now go on to adding processing of MESSAGE, PUBLISH
>>>>>>> NOTIFY etc.
>>>>>>>
>>>>>>> Thank you
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Jun 15, 2009 at 10:14 AM, Eric PTAK <eric.ptak.fr at gmail.com>wrote:
>>>>>>>
>>>>>>>> Did you added LD_PRELOAD=/path/to/your/libpurple.so env var in your
>>>>>>>> ctl script ?
>>>>>>>>
>>>>>>>> Eric.
>>>>>>>>
>>>>>>>> 2009/6/15 mani sivaraman <mani.opensips at gmail.com>
>>>>>>>>
>>>>>>>> Thanks for getting back Eric. After opensips I tested the latest
>>>>>>>>> Kamailio 1.5.1 code with purple module. I get the same SIGCHLD core dump on
>>>>>>>>> Kamailio as well. I saw Kamailio comes with purple source code. If I load
>>>>>>>>> purple.so and then add the modprobe for purple, I get the core dump. Is
>>>>>>>>> there any thing I can check or look for in the debug to make sure it works.
>>>>>>>>> If I unload purple and remove the respective modprobes every thing seems to
>>>>>>>>> work fine.
>>>>>>>>>
>>>>>>>>> Thank you
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Jun 15, 2009 at 3:15 AM, Eric PTAK <eric.ptak.fr at gmail.com
>>>>>>>>> > wrote:
>>>>>>>>>
>>>>>>>>>> Hi mani,
>>>>>>>>>>
>>>>>>>>>> purple module hasn't been tested with opensips, and I can't say if
>>>>>>>>>> it should work.
>>>>>>>>>> but just a question : how did you compile the module ? eg, within
>>>>>>>>>> which project ?
>>>>>>>>>>
>>>>>>>>>> regards,
>>>>>>>>>> eric.
>>>>>>>>>>
>>>>>>>>>> 2009/6/12 mani sivaraman <mani.opensips at gmail.com>
>>>>>>>>>>
>>>>>>>>>>>  I compiled and installed opensips 1.5.1 with mysql db and works
>>>>>>>>>>> fine. I compiled and installed the new purple module from outside and
>>>>>>>>>>> installed the same. if I try to load the purple.so module and add modprobe
>>>>>>>>>>> for purple params, opensips core dumps saying
>>>>>>>>>>>
>>>>>>>>>>> Jun 12 12:06:38 [22121] CRITICAL:core:receive_fd: EOF on 15
>>>>>>>>>>> Jun 12 12:06:38 [22103] INFO:core:handle_sigs: child process
>>>>>>>>>>> 22110 exited by a signal 11
>>>>>>>>>>> Jun 12 12:06:38 [22103] INFO:core:handle_sigs: core was generated
>>>>>>>>>>> Jun 12 12:06:38 [22103] INFO:core:handle_sigs: terminating due to
>>>>>>>>>>> SIGCHLD
>>>>>>>>>>> Jun 12 12:06:38 [22104] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22105] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22106] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22107] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22108] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22114] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22109] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22115] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22116] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22117] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22119] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22121] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22112] INFO:core:sig_usr: signal 15 received
>>>>>>>>>>> Jun 12 12:06:38 [22103] NOTICE:presence:destroy: destroy module
>>>>>>>>>>> ...
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> The gdb back trace is not very useful either.
>>>>>>>>>>>
>>>>>>>>>>> (no debugging symbols found)
>>>>>>>>>>> Core was generated by `opensips'.
>>>>>>>>>>> Program terminated with signal 11, Segmentation fault.
>>>>>>>>>>> [New process 22083]
>>>>>>>>>>> #0  0x085a9c6d in ?? ()
>>>>>>>>>>> (gdb) backtrace full
>>>>>>>>>>> #0  0x085a9c6d in ?? ()
>>>>>>>>>>> No symbol table info available.
>>>>>>>>>>> (gdb)
>>>>>>>>>>>
>>>>>>>>>>> Help Any one , Please.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Users mailing list
>>>>>>>>>>> Users at lists.opensips.org
>>>>>>>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Users mailing list
>>>>>>>> Users at lists.opensips.org
>>>>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20090618/e3647b49/attachment.htm>


More information about the sr-users mailing list