Hi Daniel,
It's done by this cgrates route: ``` # CGRateS request for session disconnect route[CGR_SESSION_DISCONNECT] { json_get_field("$evapi(msg)", "HashEntry", "$var(HashEntry)"); json_get_field("$evapi(msg)", "HashId", "$var(HashId)"); json_get_field("$evapi(msg)", "Reason", "$var(Reason)"); jsonrpc_exec('{"jsonrpc":"2.0","id":1, "method":"dlg.end_dlg","params":[$(var(HashEntry){s.rm,"}),$(var(HashId){s.rm,"})]}'); } ```
It executes a dlg.end_dlg via jsonrpc. -- Aleksandar Sosic mail: alex.sosic@timenet.it skype: alex.sosic cell: +385 91 2505 146
On Mon, Oct 30, 2017 at 5:57 PM, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
On 30.10.17 17:29, Aleksandar Sosic wrote:
Hi Everyone,
we're trying to implement cgrates in our kamailio nodes. Everything is working fine except for the fact that kamailio is not signaling the call end to cgrates for prepaid users... The versions, logs and confs are:
# kamailio -v version: kamailio 5.0.3 (x86_64/linux) flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, 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 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled with gcc 5.3.1
# cgr-engine --version CGRateS 0.9.1~rc8 git+15a0793 (2017-10-23T12:15:40+02:00)
The kamailio conf regarding our problem is:
# Inform CGRateS about CALL_END (stop debit loops, perform accounting if desired in this way) route[CGR_CALL_END] { if $sht(cgrconn=>cgr) == $null { xlog("Charging controller unreachable"); exit; } $var(callDur) = $TS - $dlg(start_ts); evapi_relay("{\"event\":\"CGR_CALL_END\", \"callid\":\"$dlg(callid)\", \"from_tag\":\"$dlg(from_tag)\", \"cgr_reqtype\":\"$dlg_var(cgrReqType)\", \"cgr_tenant\":\"$dlg_var(cgrTenant)\", \"cgr_account\":\"$dlg_var(cgrAccount)\", \"cgr_destination\":\"$dlg_var(cgrDestination)\", \"cgr_answertime\":\"$dlg(start_ts)\", \"cgr_duration\":\"$var(callDur)\", \"cgr_supplier\":\"$dlg_var(cgrSupplier)\", \"cgr_disconnectcause\":\"$T_reply_code\"}"); }
The kamailio logs:
17(114) ERROR: evapi [evapi_dispatch.c:707]: _evapi_relay(): failed to pass the pointer to evapi dispatcher 17(114) ERROR: evapi [evapi_mod.c:261]: w_evapi_relay(): failed to relay event: {"event":"CGR_CALL_END", [...]
does this happen on BYE or on dialog timeout?
Cheers, Daniel
-- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com Kamailio World Conference - www.kamailioworld.com