<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,<br>
</p>
<br>
<div class="moz-cite-prefix">On 18.10.18 15:23, Володимир Іванець
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOQgkjZGTivfDUHgqnafTejG3peafUb3=r4+zY4qtKcxPG8RrQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hello all!
<div><br>
</div>
<div>I have <b>event_route[websocket:closed]</b> configured.
By using <b>$si</b>, <b>$sp</b>
variables and data from special hash table
I can figure out information about account
that was disconnected. I'm trying to use <b>unregister</b>
function against but with no luck.</div>
<div><br>
</div>
<div>1. I'm creating variable which contains
(as an example): "<a
href="mailto:sip%3A100-test@127.0.0.1"
moz-do-not-send="true">sip:100-test@127.0.0.1</a>"
string, where "100-test" is username.</div>
<div>2. lookup("location", "$var(user_uri)")
- runs fine. I'm getting a match and lots
of useful variables including <b>$ruid</b> are
being set:</div>
<div><i>/usr/sbin/kamailio[27169]: DEBUG:
registrar [lookup.c:256]:
lookup_helper(): contact for [100-test]
found by address</i><br>
</div>
<div><br>
</div>
<div>3. But unfortenately <b>unregister</b> with
same variable does not
work. unregister("location",
"$var(user_uri)"):</div>
<div>
<div><i>DEBUG: <core>
[core/parser/parse_uri.c:1282]:
parse_uri(): bad uri, state 0 parsed:
<you@> (4) / <<a
href="mailto:you@kamailio.org"
moz-do-not-send="true">you@kamailio.org</a>>
(16)</i></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
the variable seems to have only username@domain, not
<a class="moz-txt-link-freetext" href="sip:username@domain">sip:username@domain</a> (which is a valid sip uri). Try with:<br>
<br>
unregister("location", <a class="moz-txt-link-rfc2396E" href="sip:$var(user_uri)">"sip:$var(user_uri)"</a>)<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite"
cite="mid:CAOQgkjZGTivfDUHgqnafTejG3peafUb3=r4+zY4qtKcxPG8RrQ@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>
<div><i>ERROR: <core>
[core/parser/parse_to.c:81]:
parse_to_uri(): failed to parse To uri</i></div>
<div><i>ERROR: registrar [save.c:1040]:
unregister(): failed to extract
Address Of Record</i></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<i></i><br>
<blockquote type="cite"
cite="mid:CAOQgkjZGTivfDUHgqnafTejG3peafUb3=r4+zY4qtKcxPG8RrQ@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><i><br>
</i></div>
<div>I was trying to manipulate <b>$var(user_uri)</b>
variable's content but could not make it
work.</div>
<div><br>
</div>
<div>It's interesting that variant with <b>$ruid</b> - <b>unregister("location",
"", "$ruid")</b> will work but
unfortenately it works only with <b>modparam("usrloc",
"db_mode", 1)</b>:</div>
<div><i>ERROR: usrloc [urecord.c:655]:
delete_urecord_by_ruid():
delete_urecord_by_ruid currently
available only in db_mode=3</i><br>
</div>
<div><br>
</div>
<div>I was wonderring if someone could tell
me if I'm just using <b>unregister</b> function
with uri parameter in wrong format or
there might be some other problem.</div>
<div><br>
</div>
<div>Thanks a lot!</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference -- <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a>
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a></pre>
</body>
</html>