[sr-dev] [kamailio/kamailio] could not make ul_rm_contact work (#1027)

aqsyounas notifications at github.com
Fri Mar 10 15:27:43 CET 2017


Hi, i am trying to remove a specific contact from memroy but to no avail. Here is what I had tried. 
root at debian:/usr/local/kamailio/sbin# ./kamctl ul show
Domain:: location table=1024 records=1 max_slot=1
        AOR:: 1040 at 192.168.1.10
                Contact:: sip:1040 at 192.168.1.8:45573;rinstance=5494290a28b07472;transport=tcp Q=
                        Expires:: 3366
                        Callid:: J2MpU81af1hZ7bj2eLBAHQ..
                        Cseq:: 2
                        User-agent:: Z 3.9.32144 r32121
                        State:: CS_SYNC
                        Flags:: 0
                        Cflag:: 0
                        Socket:: tcp:192.168.1.10:5060
                        Methods:: 5087
                        Ruid:: uloc-5891af42-b58-3
                        Reg-Id:: 0
                        Last-Keepalive:: 1485943492
                        Last-Modified:: 1485943492

./kamctl fifo ul_rm_contact location 1040 at 191.168.1.10 sip:1040 at 192.168.1.8:45573;rinstance=5494290a28b07472;transport=tcp
404 AOR not found

root at debian:/usr/local/kamailio/sbin# ./kamctl ul show
Domain:: location table=1024 records=1 max_slot=1
        AOR:: 1040 at 192.168.1.10
                Contact:: sip:1040 at 192.168.1.8:45573;rinstance=5494290a28b07472;transport=tcp Q=
                        Expires:: 3064
                        Callid:: J2MpU81af1hZ7bj2eLBAHQ..
                        Cseq:: 2
                        User-agent:: Z 3.9.32144 r32121
                        State:: CS_SYNC
                        Flags:: 0
                        Cflag:: 0
                        Socket:: tcp:192.168.1.10:5060
                        Methods:: 5087
                        Ruid:: uloc-5891af42-b58-3
                        Reg-Id:: 0
                        Last-Keepalive:: 1485943492
                        Last-Modified:: 1485943492

I had tried to unregister with ruid. Code snippet. 

if(reg_fetch_contacts("location", "$fu", "caller"))
{
  xlog("caller=>aor: $(ulc(caller=>aor))\n");
  xlog("caller=>domain: $(ulc(caller=>domain))\n");
  xlog("caller=>aorhash $(ulc(caller=>aorhash))\n");
  xlog("caller=>count $(ulc(caller=>count))\n");
  xlog("caller=>ruid $(ulc(caller=>ruid))\n");
  $var(i) = 0;
  while($var(i) < $(ulc(caller=>count)))
  {
    xlog("--- contact [$var(i)]\n");
    if ($(ulc(caller=>user_agent)[$var(i)]) == 'Jitsi2.10.5550Windows 10') {
                xlog("found the culpit now removing it");
                unregister("location", "", "$(ulc(caller=>ruid)[$var(i)])");
     }
    xlog("caller=>addr:       $(ulc(caller=>addr)[$var(i)])\n");
    xlog("caller=>path:       $(ulc(caller=>path)[$var(i)])\n");
    xlog("caller=>received:   $(ulc(caller=>received)[$var(i)])\n");
    xlog("caller=>expires:    $(ulc(caller=>expires)[$var(i)])\n");
    xlog("caller=>callid:     $(ulc(caller=>callid)[$var(i)])\n");
    xlog("caller=>q:          $(ulc(caller=>q)[$var(i)])\n");
    xlog("caller=>cseq:       $(ulc(caller=>cseq)[$var(i)])\n");
    xlog("caller=>flags:      $(ulc(caller=>flags)[$var(i)])\n");
    xlog("caller=>cflags:     $(ulc(caller=>cflags)[$var(i)])\n");
    xlog("caller=>user_agent: $(ulc(caller=>user_agent)[$var(i)])\n");
    xlog("caller=>socket:     $(ulc(caller=>socket)[$var(i)])\n");
    xlog("caller=>modified:   $(ulc(caller=>modified)[$var(i)])\n");
    xlog("caller=>methods:    $(ulc(caller=>methods)[$var(i)])\n");
    $var(i) = $var(i) + 1;
  }
}
}

This is what I got in logs.

**usrloc [urecord.c:634]: delete_urecord_by_ruid(): delete_urecord_by_ruid currently available only in db_mode=3**

I am having default script having below usrloc settings

/* enable DB persistency for location entries */
#!ifdef WITH_USRLOCDB
modparam("usrloc", "db_url", DBURL)
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", MULTIDOMAIN)
modparam("usrloc", "matching_mode", 0)
#!endif


I want to remove a specific contact from memory and using default cfg file. 
 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1027
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170310/a02f53ec/attachment.html>


More information about the sr-dev mailing list