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