mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
Adding disconnect cause in kamailio SM, modified tests
This commit is contained in:
@@ -29,6 +29,12 @@ event_route[dialog:end] {
|
||||
route(CGR_CALL_END);
|
||||
}
|
||||
|
||||
# Called by Kamailio on local disconnect
|
||||
event_route[tm:local-request] {
|
||||
route(CGR_CALL_END);
|
||||
}
|
||||
|
||||
|
||||
# Send AUTH_REQUEST to CGRateS
|
||||
route[CGRATES_AUTH_REQUEST] {
|
||||
# Auth INVITEs with CGRateS
|
||||
@@ -106,6 +112,7 @@ route[CGR_CALL_END] {
|
||||
\"cgr_destination\":\"$dlg_var(cgrDestination)\",
|
||||
\"cgr_answertime\":\"$dlg(start_ts)\",
|
||||
\"cgr_duration\":\"$var(callDur)\",
|
||||
\"cgr_supplier\":\"$dlg_var(cgrSupplier)\"}");
|
||||
\"cgr_supplier\":\"$dlg_var(cgrSupplier)\",
|
||||
\"cgr_disconnectcause\":\"$T_reply_code\"}");
|
||||
}
|
||||
|
||||
|
||||
@@ -187,18 +187,15 @@ request_route {
|
||||
|
||||
# Here will land requests after processing them with CGRateS. Call RELAY or other routes following this route
|
||||
route[CGRATES_AUTH_REPLY] {
|
||||
xlog("CGRATES_AUTH_REPLY reply, got CgrError: $var(CgrError)");
|
||||
if $var(CgrError) != "" {
|
||||
xlog("CGR_AUTH_ERROR: $var(CgrError)");
|
||||
sl_send_reply("503","CGR_ERROR");
|
||||
exit;
|
||||
}
|
||||
xlog("CGRATES_AUTH_REPLY, CgrMaxSessionTime: $var(CgrMaxSessionTime)");
|
||||
if $var(CgrMaxSessionTime) != -1 && !dlg_set_timeout("$var(CgrMaxSessionTime)") {
|
||||
sl_send_reply("503","CGR_MAX_SESSION_TIME_ERROR");
|
||||
exit;
|
||||
}
|
||||
xlog("CGRATES_AUTH_REPLY, CgrSuppliers: $var(CgrSuppliers)");
|
||||
if $var(CgrSuppliers) != "" { # Enforce the supplier variable to the first one received from CGRateS, more for testing purposes
|
||||
$dlg_var(cgrSupplier) = $(var(CgrSuppliers){s.select,0,,});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user