Hi, i am trying to remove a specific contact from memroy but to no avail. Here is what I had tried. root@debian:/usr/local/kamailio/sbin# ./kamctl ul show Domain:: location table=1024 records=1 max_slot=1 AOR:: 1040@192.168.1.10 Contact:: sip:1040@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@191.168.1.10 sip:1040@192.168.1.8:45573;rinstance=5494290a28b07472;transport=tcp 404 AOR not found
root@debian:/usr/local/kamailio/sbin# ./kamctl ul show Domain:: location table=1024 records=1 max_slot=1 AOR:: 1040@192.168.1.10 Contact:: sip:1040@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.
For the kamctl command, you have to enclose the contact address parameter in quotes, otherwise the shell will split parameter at the first `;`, which is delimiter for shell commands. So try with something like:
``` ./kamctl fifo ul_rm_contact location 1040@191.168.1.10 'sip:1040@192.168.1.8:45573;rinstance=5494290a28b07472;transport=tcp' ```
Have you had the chance to test it as per previous comment?
Sorry I was out of office for several days. I will inform you later today about the results. Again Sorry for the delay.
On 15 March 2017 at 13:55, Daniel-Constantin Mierla < notifications@github.com> wrote:
Have you had the chance to test it as per previous comment?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/1027#issuecomment-286678655, or mute the thread https://github.com/notifications/unsubscribe-auth/AHG6m58ozlh01E9OR-eV4tFSKUOPTfKrks5rl6ePgaJpZM4MZcYc .
Thanks it worked perfectly. root@debian:/usr/local/kamailio/sbin# ./kamctl fifo ul_rm_contact location 1040@saevolgo.ca 'sip:1040@192.168.1.6:63625;rinstance=a9a0e622352e6b5a;transport=UDP' root@debian:/usr/local/kamailio/sbin# root@debian:/usr/local/kamailio/sbin# ./kamctl ul show Domain:: location table=1024 records=1 max_slot=1 AOR:: 1040@saevolgo.ca Contact:: sip:1040@192.168.1.6:63625;rinstance=a9a0e622352e6b5a;transport=UDP Q= Expires:: deleted Callid:: ommuBmQf9njcG6kTeAcmjA.. Cseq:: 2 User-agent:: Z 3.9.32144 r32121 State:: CS_SYNC Flags:: 0 Cflag:: 0 Socket:: udp:192.168.1.27:5060 Methods:: 5087 Ruid:: uloc-58c94581-362d-1 Reg-Id:: 0 Last-Keepalive:: 1489585541 Last-Modified:: 1489585541
Closed #1027.