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

2013-05-13 Thread Juha Heinanen
Daniel-Constantin Mierla writes: > For db only the sql query can be done only on ruid (for update and > delete), there is a parameter for that now. yes, but at least in case of unregister, the implementation is inefficient, because before calling delete, it needs to call get: if

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

2013-05-13 Thread Daniel-Constantin Mierla
On 5/13/13 6:44 AM, Juha Heinanen wrote: Peter Dunkley writes: I suppose an alternative function that just needs ruid could be written - but it would be much less efficient as it would have to linearly search all records (unless an additional hash on ruid is added - and a DB index on it too).

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

2013-05-12 Thread Juha Heinanen
Peter Dunkley writes: > I suppose an alternative function that just needs ruid could be written - > but it would be much less efficient as it would have to linearly search > all records (unless an additional hash on ruid is added - and a DB index > on it too). thanks for the explanation. now tha

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

2013-05-12 Thread Peter Dunkley
The usrloc function that locates a record by ruid takes in an aorhash value as an argument (and to get the aorhash value you need the AoR). I suppose an alternative function that just needs ruid could be written - but it would be much less efficient as it would have to linearly search all records

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

2013-05-12 Thread Juha Heinanen
Peter Dunkley writes: > 3) Use a hash-table to store $ruid, $tU, and $td indexed on $si:$sp > 4) Then when event_route[websocket:closed] is called you can retrieve the > information from the hash table and call unregister(). Use the $tU and > $td you have cached to construct the unregister() URI

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

2013-05-11 Thread אורן אברהם
Hi. Just for the record, I found another way to acheve the "unregister" in my case (but maybe someone else still needs to above method...) : I've saved some info from the REGISTER message in an HTABLE and used the UAC module to send an unregister message (same as the original, just changed the 'exp

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

2013-05-11 Thread Daniel-Constantin Mierla
Hello, On 5/11/13 11:28 AM, Peter Dunkley wrote: When you call unregister() without the new ruid parameter it parses the current SIP message to get information needed to do the unregister(). There is no real SIP message associated with an event_route[] so unregister() will not work. The way to

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

2013-05-11 Thread Peter Dunkley
When you call unregister() without the new ruid parameter it parses the current SIP message to get information needed to do the unregister(). There is no real SIP message associated with an event_route[] so unregister() will not work. The way to get this working is: 1) Use Git master so that unre

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

2013-05-10 Thread Iwan Budi Kusnanto
On Mon, May 6, 2013 at 4:19 PM, Peter Dunkley wrote: >> and by the way, I found another problem when implementing the first >> method: >> when calling unregister("location","websocket=>$si:$sp)" from the >> event_route[websocket:closed] i get the following error: >> *[parser/parse_to.c:879] : fai

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

2013-05-06 Thread Peter Dunkley
> When stating "stable" and "bug-free" - my intention was relativly to that > feature in kamailio because it seems that it is still under development. > Moreover - certainly if i will find any problem while testing i would > submit a bug-report and bug-fixes if possible. > > and by the way, I fou

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

2013-05-05 Thread אורן אברהם
When stating "stable" and "bug-free" - my intention was relativly to that feature in kamailio because it seems that it is still under development. Moreover - certainly if i will find any problem while testing i would submit a bug-report and bug-fixes if possible. and by the way, I found another p

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

2013-05-03 Thread Peter Dunkley
On 03/05/13 14:48, ? wrote: 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 dis

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

2013-05-03 Thread אורן אברהם
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

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

2013-05-02 Thread Peter Dunkley
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

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

2013-05-02 Thread Peter Dunkley
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

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

2013-05-01 Thread אורן אברהם
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 th