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

Peter Dunkley peter.dunkley at crocodile-rcs.com
Sat May 11 11:28:41 CEST 2013


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


-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd




More information about the sr-users mailing list