[OpenSIPS-Users] Multiple Presence Servers

James Lamanna jlamanna at gmail.com
Thu Aug 11 18:42:18 CEST 2011


Hi Bogdan,
The only way I see that scenario working is to forward SUBSCRIBEs
messages to the server that a phone is registered on.
(If you do it some other way, the presence module will not generate a
PUBLISH because it doesn't see a SUBSCRIBE).
However, there is a real problem with this when it comes to
subscription renewals and if a phone was plugged in before another
registered:

Imaging the following scenario, phone A wants to monitor phone B.
Phone A and B are not registered.

Phone A gets plugged in, registers to S1, and sends a SUBSCRIBE for B.
Phone B isn't registered so we don't know where to route it.
We could do a couple things:
1) Only handle the SUBSCRIBE on S1
2) Broadcast the SUBSCRIBE to all servers (S1...Sn)
3) Reject the SUBSCRIBE
Now lets say phone B is plugged in and is not registered on Si (not S1).

At this point phone A is sending subscription renewals with a to_tag.
Unfortunately, if B is not registered on S1, all subsequent
subscription renewals will fail, because the to_tag that Si generates
is different than what the phone is sending. The only way to recover
from this is to reboot phone A.

Am I missing something here?

One "solution" that I've implemented is that any distributed SUBSCRIBE
from S1 has its to_tag stripped off.
This has the effect of creating a new subscription each time on each
of the other servers, which actually seems to work quite well.
PUBLISHes are handled by each local server and then forwarded to the
correct place by using the recorded route
from the SUBSCRIBE.

-- James

On Mon, Aug 8, 2011 at 12:42 PM, Bogdan-Andrei Iancu
<bogdan at opensips.org> wrote:
> Hi James,
>
> I thing your approach on multi Presence Servers is correct. You cannot
> simple fork the SUBSCRIBE to all servers, as this will break how presence
> works.
>
> the presence state must stay on a single server, so all PUBLISHs for entity
> A and all SUBSCRIBES to entity A must go to the same presence server.
>
> Regards,
> Bogdan
>
> On 08/05/2011 11:31 AM, James Lamanna wrote:
>>
>> Hi,
>> I'd like to know if it is possible to have multiple presence servers.
>> The idea is to distribute SUBSCRIBE messages around so that each
>> presence server is aware of all subscriptions.
>> However, it seems as though there is a problem with the to_tag when
>> doing this since it is used as a matching mechanism.
>> When we have subscription renewals from a phone, it transmits the
>> to_tag of the server it was registered with initially.
>> This server then tries to distribute the SUBSCRIBE to the other
>> servers. However, because each server generated its own to_tag
>> with the initial SUBSCRIBE, each server returns with a 481
>> Subscription Not Found.
>>
>> Is there any way to work around this issue?
>>
>> Thanks.
>>
>> -- James
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS eBootcamp - 19th of September 2011
> OpenSIPS solutions and "know-how"
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list