Kamailio:

- Missed calls configuration
    - Add evapi listen address
This commit is contained in:
Eloy Coto
2015-05-04 09:12:02 +01:00
parent 72f39254f0
commit a518ee769a
2 changed files with 19 additions and 5 deletions

View File

@@ -25,6 +25,11 @@ event_route[dialog:end] {
route(CGR_CALL_END);
}
event_route[dialog:failed] {
$avp(s:missed_call) = 1;
route(CGR_CALL_END);
}
# Send AUTH_REQUEST to CGRateS
route[CGR_AUTH_REQUEST] {
# Auth INVITEs with CGRateS
@@ -114,14 +119,21 @@ route[CGR_CALL_END] {
xlog("Charging controller unreachable");
exit;
}
$var(callDur) = $TS - $dlg(start_ts);
# As default the duration is 0.
# If missed_call avp doesn't exists system send the correct duration
$var(callDur) = 0;
if( $avp(s:missed_call) == $null){
$var(callDur) = $TS - $dlg(start_ts);
}
evapi_async_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_account\":\"$dlg_var(cgrAccount)\",
\"cgr_destination\":\"$dlg_var(cgrDestination)\",
\"cgr_answertime\":\"$dlg(start_ts)\",
\"cgr_duration\":\"$var(callDur)\"}");
}
}

View File

@@ -51,8 +51,6 @@ loadmodule "dialog.so"
loadmodule "xhttp.so"
loadmodule "jsonrpc-s.so"
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
@@ -93,6 +91,10 @@ modparam("usrloc", "nat_bflag", FLB_NATB)
modparam("htable", "htable", "users=>size=8;")
modparam("htable", "htable", "cgrconn=>size=1;")
modparam("evapi", "workers", 2)
modparam("evapi", "bind_addr", "127.0.0.1:8448")
####### Routing Logic ########
include_file "kamailio-cgrates.cfg"