<div dir="rtl"><div dir="ltr">Hi.</div><div dir="ltr">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)</div>
<div dir="ltr"><br></div><div dir="ltr" style>(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.)</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2013/5/11 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div class="im"><br>
<br>
On 5/11/13 11:28 AM, Peter Dunkley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When you call unregister() without the new ruid parameter it parses the<br>
current SIP message to get information needed to do the unregister().<br>
<br>
There is no real SIP message associated with an event_route[] so<br>
unregister() will not work.<br>
<br>
The way to get this working is:<br>
1) Use Git master so that unregister() with ruid is supported<br>
2) Modify save() so that upon successful creation of new contact it copies<br>
the ruid created by usrloc into the sip_msg.ruid variable for the current<br>
SIP message.  This means that on return from save() the $ruid PV will<br>
work.<br>
</blockquote>
<br></div>
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:<br>
<br>
<a href="http://kamailio.org/docs/modules/stable/modules/registrar.html#idp1752184" target="_blank">http://kamailio.org/docs/<u></u>modules/stable/modules/<u></u>registrar.html#idp1752184</a><br>
<br>
But now that ruid is part of sip message structure, might be good to store it there, could be faster accessed.<br>
<br>
Cheers,<br>
Daniel<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3) Use a hash-table to store $ruid, $tU, and $td indexed on $si:$sp<br>
4) Then when event_route[websocket:closed] is called you can retrieve the<br>
information from the hash table and call unregister().  Use the $tU and<br>
$td you have cached to construct the unregister() URI parameter.<br>
<br>
Regards,<br>
<br>
Peter<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, May 6, 2013 at 4:19 PM, Peter Dunkley<br>
<<a href="mailto:peter.dunkley@crocodile-rcs.com" target="_blank">peter.dunkley@crocodile-rcs.<u></u>com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and by the way, I found another problem when implementing the first<br>
method:<br>
when calling unregister("location","<u></u>websocket=>$si:$sp)" from the<br>
event_route[websocket:closed] i get the following error:<br>
*[parser/parse_to.c:879] : failed to parse To uri*<br>
why it happens and how can i fix it ? (i think it is related to the<br>
fact<br>
we<br>
call unregister from the event_route, but i'm not sure)<br>
<br>
</blockquote>
You can't call unregister from that event_route.<br>
</blockquote>
Why we can't call unregister from event_route[websocket:closed]?<br>
Is it because it is just not implemented yet or we need big changes to<br>
implement it?<br>
<br>
Thanks,<br>
<br>
--<br>
Iwan Budi Kusnanto<br>
<br>
______________________________<u></u>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a><br>
<br>
</blockquote>
<br>
</blockquote>
<br>
-- <br></div></div>
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/<u></u>miconda</a><br>
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013<br>
  * <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a> *<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a><br>
</div></div></blockquote></div><br></div>