Hi,
I'm trying to limit concurrent calls through kamailio using following script: #!ifdef WITH_CALL_LIMIT if (is_method("INVITE")) { dlg_manage(); $var(100) = 0; get_profile_size("callquota", "$fd", "$var(100)"); if ($var(100) >= 100 ) { xdbg("DEBUG: Simultaneous calls limit reached"); sl_send_reply("503","Simultaneous calls limit reached"); exit; }
set_dlg_profile("callquota","$fd");
} #!endif
But the dialogs are not cleaned up after the call ends or a failed call happens.
For example after two failed calls :
[root@new tls]# kamctl fifo profile_get_size callquota profile:: name=callquota value= count=4
and the dialog list :
[root@new tls]# kamctl fifo dlg_list dialog:: hash=896:11654 state:: 1 ref_count:: 1 timestart:: 0 timeout:: 0 callid:: iSGRqQR0C4suBpQD0rHAEgV42vw0Sbpe from_uri:: sip:123@205.164.40.150 from_tag:: d8x2LDBptN9FRJWtqFTj4DIpuQlKq.KN caller_contact:: sip:123@180.149.7.45:33852;ob caller_cseq:: 11755 caller_route_set:: caller_bind_addr:: udp:185.8.105.70:9547 callee_bind_addr:: to_uri:: sip:8801684077496@205.164.40.150 to_tag:: callee_contact:: callee_cseq:: callee_route_set:: dialog:: hash=896:11655 state:: 1 ref_count:: 1 timestart:: 0 timeout:: 0 callid:: iSGRqQR0C4suBpQD0rHAEgV42vw0Sbpe from_uri:: sip:123@205.164.40.150 from_tag:: d8x2LDBptN9FRJWtqFTj4DIpuQlKq.KN caller_contact:: sip:123@180.149.7.45:33852;ob caller_cseq:: 11755 caller_route_set:: caller_bind_addr:: udp:185.8.105.70:9547 callee_bind_addr:: to_uri:: sip:8801684077496@205.164.40.150 to_tag:: callee_contact:: callee_cseq:: callee_route_set:: dialog:: hash=896:11657 state:: 1 ref_count:: 1 timestart:: 0 timeout:: 0 callid:: iSGRqQR0C4suBpQD0rHAEgV42vw0Sbpe from_uri:: sip:123@205.164.40.150 from_tag:: d8x2LDBptN9FRJWtqFTj4DIpuQlKq.KN caller_contact:: sip:123@180.149.7.45:33852;ob caller_cseq:: 11756 caller_route_set:: caller_bind_addr:: udp:185.8.105.70:9547 callee_bind_addr:: to_uri:: sip:8801684077496@205.164.40.150 to_tag:: callee_contact:: callee_cseq:: callee_route_set:: dialog:: hash=1532:8089 state:: 1 ref_count:: 1 timestart:: 0 timeout:: 0 callid:: povqQaC.sRhKvmUaLzzR83bRXxouoNy8 from_uri:: sip:123@205.164.40.150 from_tag:: qXQll3QXrff.t27FHY2hucPfJ7K8Pfrs caller_contact:: sip:123@180.149.7.45:33852;ob caller_cseq:: 9232 caller_route_set:: caller_bind_addr:: udp:185.8.105.70:9547 callee_bind_addr:: to_uri:: sip:8801684077496@205.164.40.150 to_tag:: callee_contact:: callee_cseq:: callee_route_set::
You can see there are multiple entries. And these dialog does not get cleaned up. The data is collected when there was no call(pending or connected).
My kamailio version is :
[root@new tls]# kamailio -V version: kamailio 4.0.0-pre0 (x86_64/linux) 83eafc flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: 83eafc compiled on 18:34:58 Jan 17 2013 with gcc 4.4.6
Any suggestion?(It seems dialog module is not working as it should be. I've also tried calling unset_profile() forcefully in failure route with no luck) -- -aft