[SR-Users] Doing automatic unregister when a WEBSOCKET connection is closed.

Peter Dunkley peter.dunkley at crocodile-rcs.com
Thu May 2 15:02:07 CEST 2013


Hello,

When the register succeeds store the To-URI in a hash-table indexed on 
$si:$sp.

Make sure the entries in the hash-table do not automatically expire and 
use the sht_rm_name_re() function to remove the entry after you have 
called unregister.

Be careful using unregister() as unless you provide it the ruid for the 
exact location entry it will remove all contacts for that URI, not just 
the one relating to that connection.  unregister() with ruid is only 
available in Git master.  There is currently no way to find out what the 
ruid allocated after a save() is (but you could add this easily 
enough).  Note: none of this is a problem if you are permitting only one 
contact binding per subscriber.

http://kamailio.org/docs/modules/devel/modules/registrar.html#idp126168
http://kamailio.org/docs/modules/devel/modules/registrar.html#idp1681984
http://kamailio.org/docs/modules/devel/modules/htable.html

Regards,

Peter

On 02/05/13 00:01, ???? ????? wrote:
> Dear List.
>
> I'm trying to issue an automatic unregister() (of a registration) when 
> a websocket connection is closed. it is useful when the browser is 
> closed without issuing REGISTER with expires=0.
>
> i've tried implementing this using the event_route[websocket:closed] 
> but i don't know how to find the registration uri from the $si:$sp. 
> (that is needed for the unregister() function from the registrar module)
>
> thanks for all replies in advance....
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130502/a7a6beb4/attachment.html>


More information about the sr-users mailing list