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

אורן אברהם oren.av.jnk at gmail.com
Fri May 3 15:48:47 CEST 2013


I've tried to implement the first method you've stated. it seems ok but
i've found a more fundamental problem:
The event_route[websocket:closed] is called only when i teminate the sip
stack in my browser, but if i  close the browser, without  a "regular
disconnect" then the w*ebsocket:closed event is not triggered*. (and this
is my main target for the question)
*how can i make it trigger ?*

p.s: about the outbound,path method, *is it a stable feature and
bug-free ?*I see the default configuration is still using the
nathelper hack instead
of it.

regards.


2013/5/2 Peter Dunkley <peter.dunkley at crocodile-rcs.com>

>  I should add...  A better option is just to use an outbound edge proxy
> and remove the contact when you get a 430 response back from the edge
> proxy.  This is the correct way to handle such things.
>
> There are example configurations in the latest Git master (in the
> /examples directory).
>
>
> On 02/05/13 14:02, Peter Dunkley wrote:
>
> 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 listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> _______________________________________________
> 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/20130503/b6667195/attachment-0001.html>


More information about the sr-users mailing list