ResourceLimit with AllocationMessage

This commit is contained in:
DanB
2017-05-11 21:20:56 +02:00
parent 3f959ae267
commit 4d41c6552c
15 changed files with 168 additions and 82 deletions

View File

@@ -117,13 +117,13 @@ route[CGRATES_RL_REQUEST] {
\"cgr_setuptime\":\"$TS\"}");
}
# Process LCR_REPLY from CGRateS
# Process RL_REPLY from CGRateS
route[CGR_RL_REPLY] {
json_get_field("$evapi(msg)", "ResourceAllowed", "$var(CGRResourceAllowed)");
json_get_field("$evapi(msg)", "ResourceAllocated", "$var(CGRResourceAllocated)");
json_get_field("$evapi(msg)", "Error", "$var(CgrError)");
$var(id_index) = $(var(TransactionIndex){s.int});
$var(id_label) = $(var(TransactionLabel){s.int});
$var(CGRResourceAllowed) = $(var(CGRResourceAllowed){s.rm,"});
$var(CGRResourceAllocated) = $(var(CGRResourceAllocated){s.rm,"});
$var(CgrError) = $(var(CgrError){s.rm,"});
t_continue("$var(id_index)", "$var(id_label)", "CGRATES_RL_REPLY"); # Unpark the transaction
}

View File

@@ -220,7 +220,7 @@ route[CGRATES_RL_REPLY] {
sl_send_reply("503","CGR_ERROR");
exit;
}
if $var(CGRResourceAllowed) == "false" {
if $var(CGRResourceAllocated) == "false" {
sl_send_reply("403","Resource not allowed");
exit;
}