[OpenSIPS-Users] Presence for routing logic
Anca Vamanu
anca at opensips.org
Thu Feb 17 17:57:10 CET 2011
Hi Carlo,
On 02/17/2011 11:48 AM, Carlo Dimaggio wrote:
> Il 16/02/11 18.19, Anca Vamanu ha scritto:
>> Hi Carlo,
>>
>> Here are my ideas about this.
>> One solution would be to insert into usr_preferences table a record
>> with the URI where the call must be forwarded for the user (you can
>> put the username in RURI) when the presence status is "meeting",
>> "holiday", etc. And delete it when changes into something else.
>> Now the question is where to do this. In the OpenSIPS script is very
>> hard - you have to make regexps to extract the status from the
>> Publish body, select from database the previous stored state and
>> apply the regexp again, very inefficient. The other solutions are an
>> external application or an opensips module. The external application
>> could query the presentity table periodically or maybe be called by a
>> trigger at insert ( not sure this is possible). The module can export
>> a function to be called before handle_publish to analyze the previous
>> and the current state.
>> Then when handling Invites - do avp_db_load for the caller and if a
>> record is found forward it to that URI.
>
> Hi Anca,
> thank you for your interesting point of view.
>
> Indeed I was thinking about the development of a new presence module
> (or a function) but for checking the subscriber status directly from
> the XCAP server. In this way in the script (INVITE) I should do
> xcap_check_status for the callee, do an avp_db_load and forward the
> caller to the URI stored in usr_preferences (linked to the presence
> status).
XCAP server does not store the published presence state, but only a
permanent state - through pidf manipulation (RFC 4827) ( not sure though
what clients support this).
So in fact for your design, you should maybe query the published state
in presence server and also check if the user has some default state set
in XCAP server.
One of our development projects this year will be add an event
notification interface to OpenSIPS. And presence status change events
will also be included. It will be announced soon, stay tuned :) . Then
it will be possible to have an external application that will be
notified when a status change occurs for a user, maybe also say which
was the previous status. And your external application can do anything
with it - insert/delete a row usr_preferences for example.
Regards,
--
Anca Vamanu
OpenSIPS Developer
>
> This is just a proof of concept, as I need a better understanding of
> all opensips presence modules.
>
>
> Best regards,
> Carlo Dimaggio
>
>
> _______________________________________________
> 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.opensips.org/pipermail/users/attachments/20110217/4a16c79c/attachment.htm>
More information about the Users
mailing list