<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello Daniel!<div><br></div><div>Thank you for the responce. It has "sip:" in the front. Here is how it gets created: $var(user_uri) = "sip:" + $var(user) + "@<a href="http://127.0.0.1">127.0.0.1</a>" and here is debug log:</div><div><br></div><div><div><i>DEBUG: <script>: == TRACE. websocket:closed</i></div><div><i>DEBUG: <script>: == TRACE. websocket:closed. WebSocket connection from <a href="http://127.0.0.1:48640">127.0.0.1:48640</a> has closed. User: 100-test</i></div><div><i>DEBUG: <script>: == TRACE. websocket:closed. user_uri: <b><a href="mailto:sip%3A100-test@127.0.0.1">sip:100-test@127.0.0.1</a></b></i></div><div><i>DEBUG: registrar [lookup.c:256]: lookup_helper(): contact for [100-test] found by address </i><b><== lookup("location", "$var(user_uri)");</b></div><div><i>DEBUG: <core> [core/parser/parse_addr_spec.c:864]: parse_addr_spec(): end of header reached, state=10</i></div><div><i>DEBUG: <core> [core/parser/msg_parser.c:171]: get_hdr_field(): <To> [20]; uri=[<a href="mailto:you@kamailio.org">you@kamailio.org</a>]</i></div><div><i>DEBUG: <core> [core/parser/msg_parser.c:172]: get_hdr_field(): to body [<<a href="mailto:you@kamailio.org">you@kamailio.org</a>></i></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">you@kamailio.org</a>> (16)</i></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><br><div class="gmail_quote"><div dir="ltr">чт, 18 жовт. 2018 о 18:29 Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> пише:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Hello,<br>
</p>
<br>
<div class="m_7848113188372497285moz-cite-prefix">On 18.10.18 15:23, Володимир Іванець
wrote:<br>
</div>
<blockquote type="cite">
<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" target="_blank">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" target="_blank">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="m_7848113188372497285moz-txt-link-freetext">sip:username@domain</a> (which is a valid sip uri). Try with:<br>
<br>
unregister("location", <a class="m_7848113188372497285moz-txt-link-rfc2396E">"sip:$var(user_uri)"</a>)<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite">
<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">
<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="m_7848113188372497285mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="m_7848113188372497285moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_7848113188372497285moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="m_7848113188372497285moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="m_7848113188372497285moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a class="m_7848113188372497285moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_7848113188372497285moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio World Conference -- <a class="m_7848113188372497285moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a>
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- <a class="m_7848113188372497285moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a></pre>
</div>
</blockquote></div>