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

אורן אברהם oren.av.jnk at gmail.com
Sun May 12 03:35:42 CEST 2013


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
'expires' contact parameter to 0)

(and i think there is a bug in the UAC module - it creates messages with a
null body that dosen't pass the sanity module check, so i've disabled the
failing test for all REGISTER messages.)


2013/5/11 Daniel-Constantin Mierla <miconda at gmail.com>

> 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 get this working is:
>> 1) Use Git master so that unregister() with ruid is supported
>> 2) Modify save() so that upon successful creation of new contact it copies
>> the ruid created by usrloc into the sip_msg.ruid variable for the current
>> SIP message.  This means that on return from save() the $ruid PV will
>> work.
>>
>
> this topic was questioned in at least another email and I forgot to
> answer. Actually save() can store the ruid in an xavp, one has to set the
> module parameter:
>
> http://kamailio.org/docs/**modules/stable/modules/**
> registrar.html#idp1752184<http://kamailio.org/docs/modules/stable/modules/registrar.html#idp1752184>
>
> But now that ruid is part of sip message structure, might be good to store
> it there, could be faster accessed.
>
> Cheers,
> Daniel
>
>
>  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 parameter.
>>
>> Regards,
>>
>> Peter
>>
>>  On Mon, May 6, 2013 at 4:19 PM, Peter Dunkley
>>> <peter.dunkley at crocodile-rcs.**com <peter.dunkley at crocodile-rcs.com>>
>>> 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] : failed to parse To uri*
>>>>> why it happens and how can i fix it ? (i think it is related to the
>>>>> fact
>>>>> we
>>>>> call unregister from the event_route, but i'm not sure)
>>>>>
>>>>>  You can't call unregister from that event_route.
>>>>
>>> Why we can't call unregister from event_route[websocket:closed]?
>>> Is it because it is just not implemented yet or we need big changes to
>>> implement it?
>>>
>>> Thanks,
>>>
>>> --
>>> Iwan Budi Kusnanto
>>>
>>> ______________________________**_________________
>>> 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<http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>
>>>
>>>
>>
> --
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/**miconda<http://www.linkedin.com/in/miconda>
> Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
>   * http://asipto.com/u/katu *
>
>
>
> ______________________________**_________________
> 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<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/20130512/a6b4ef35/attachment.html>


More information about the sr-users mailing list