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

Daniel-Constantin Mierla miconda at gmail.com
Sat May 11 11:38:11 CEST 2013


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

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> 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
>>
>

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
   * http://asipto.com/u/katu *




More information about the sr-users mailing list