<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
Hello,<BR>
<BR>
I am working with Kamailio RLS which uses PUA as a library to send SUBSCRIBEs.<BR>
<BR>
Whenever Kamailio receives an RLS subscription it calls rls_handle_subscribe().&nbsp; rls_handle_subscribe() calls the function resource_subscriptions() which in turn calls send_resource_subs() (via process_list_and_exec()).&nbsp; resource_subscriptions() and send_resource_subs() fill in a subs_info_t structure that is passed into the PUA module send_subscribe() function.<BR>
<BR>
The key part is that send_resource_subs() sets the subs_info_t remote_target field to the pres_uri.&nbsp; The PUA send_subscribe() function uses the remote_target as the remote_contact (in the ua_pres_t structure) that is used to lookup the dialog in the PUA hash table.&nbsp; Unfortunately, this lookup always fails because the PUA module correctly updates the remote contact in the hash table when it gets a response back from the (Kamailio) presence server.<BR>
<BR>
The effect that this has is that any re-SUBSCRIBE requests from the RLS module are treated as new initial SUBSCRIBEs.&nbsp; This causes the pua and (presence) watchers tables in my Kamailio database to grow rapidly, and can result in multiple notifications on a presence status change.<BR>
<BR>
I noticed this because I am currently adding a new API to RLS which will allow me to update my RLS subscriptions whenever my resource list documents change.&nbsp; This is needed so that subscribers receive an immediate presence authorisation request when someone adds them to their contact list.&nbsp; The client I am testing with tends to update the RLS documents frequently (often for superficial changes) and this combined with the PUA issue described above means with just two clients on the system (with only each other in the contact list) I can end up with many 10s of records in pua and watchers within a few minutes.<BR>
<BR>
This issue will also have a lesser effect when RLS re-SUBSCRIBEs from clients occur.&nbsp; There will be a window (until the original SUBSCRIBE expires) when there are multiple back-end SUBSCRIBE dialogs for each contact.<BR>
<BR>
Can anyone advise on this issue and suggest a solution?<BR>
<BR>
Regards,<BR>
<BR>
Peter<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>