Dear all
I have a problem, which I thought I can solve with PUA_USRLOC. I have a OpenSER SIP Proxy and want him to create presence information about the messages that pass him.
Some examples: - REGISTER: Publish as online/available - REGISTER+Expires=0: Publish as offline - INVITE/200 OK: Publish as busy - BYE: Publish as available again.
PUA_USRLOC seems to me can handle only simple on/offline according registration state, that is saved on the server. As I have only a proxy server and messages just pass by, this solution seems not the best.
What would you recommend me to solve the problem? Change the module, add a module? As I don't have that much of experience in that area I was thinking about using perl module and trigger some perl functions that parse the messages that pass the proxy and make perl send the PUBLISHes to the presence server.
Maybe some of you have other ideas or suggestions about that.... I would be happy if you share them with me.
Best regards Sebastian
Hello,
Indeed pua_usrloc reacts only to Register message. There are a lot of possibilities add that functionality for Invite and Bye. In short, you need to: - first parse the Invite or Bye message to extract the destination and the source of the call - then, get from database table 'presentity' used by the presence server, the current E-TAG value used for the publications for the respective user - and finally construct the PUBLISH message and send it to the presence server
Of course that one option is to write a module for OpenSER. It is in fact quite easy, probably the easiest way. The module will use as a engine the 'pua' module, as all pua_* modules use. The pua module exports a function 'send_publish' that receives as a parameter a structure with the necessary informations. It also stores all the current E-TAGS locally, so there is no need to worry about that either and to query a remote database. Then, you can use the functions from core to parse the INVITE message and extract info. You can use as an example the pua modules for linkage with pua module, my recommendation is pua_mi because it is the simplest.
regards, Anca
Schumann Sebastian wrote:
Dear all
I have a problem, which I thought I can solve with PUA_USRLOC. I have a OpenSER SIP Proxy and want him to create presence information about the messages that pass him.
Some examples:
- REGISTER: Publish as online/available
- REGISTER+Expires=0: Publish as offline
- INVITE/200 OK: Publish as busy
- BYE: Publish as available again.
PUA_USRLOC seems to me can handle only simple on/offline according registration state, that is saved on the server. As I have only a proxy server and messages just pass by, this solution seems not the best.
What would you recommend me to solve the problem? Change the module, add a module? As I don't have that much of experience in that area I was thinking about using perl module and trigger some perl functions that parse the messages that pass the proxy and make perl send the PUBLISHes to the presence server.
Maybe some of you have other ideas or suggestions about that.... I would be happy if you share them with me.
Best regards Sebastian
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users
El Thursday 22 May 2008 11:51:50 Schumann Sebastian escribió:
Dear all
I have a problem, which I thought I can solve with PUA_USRLOC. I have a OpenSER SIP Proxy and want him to create presence information about the messages that pass him.
Some examples:
- REGISTER: Publish as online/available
- REGISTER+Expires=0: Publish as offline
- INVITE/200 OK: Publish as busy
- BYE: Publish as available again.
How will you handle the case in which BYE is never recived? (becasue UAC crashes). Yes, then the "Expires" of the PUBLISH will work but how will you handle calls of very long duration? Note that after an INVITE it's possible you get nothing SIP until the BYE.
Hi Inaki
Due to NAT issue and timer on a following proxy, the registration period of the phones is 60 seconds. Thus, I have the possibility to keep track of the phone status.
A proper behaviour for this case is assumed: Every phone, that sent a INVITE and is alive (sends RE-REGISTER) must and will send a BYE in any case.
Regards Sebastian
-----Original Message----- From: Iñaki Baz Castillo [mailto:ibc@in.ilimit.es] Sent: Thursday, 22. May 2008 12:28 PM To: users@lists.openser.org Subject: Re: [OpenSER-Users] Problem PUA_USRLOC,Presence acc. REGISTER/INVITE
El Thursday 22 May 2008 11:51:50 Schumann Sebastian escribió:
Dear all
I have a problem, which I thought I can solve with PUA_USRLOC. I have a OpenSER SIP Proxy and want him to create presence information about the messages that pass him.
Some examples:
- REGISTER: Publish as online/available
- REGISTER+Expires=0: Publish as offline
- INVITE/200 OK: Publish as busy
- BYE: Publish as available again.
How will you handle the case in which BYE is never recived? (becasue UAC crashes). Yes, then the "Expires" of the PUBLISH will work but how will you handle calls of very long duration? Note that after an INVITE it's possible you get nothing SIP until the BYE.