Closed Digital-Daz closed 7 years ago
Can you provide some debug logs for this kind of call?
Does this help, I just gave showed this to DanB:
With: if ($rc < 0) { xlog("L_ERR","Call not authorized: rc = $rc code=$cgrret!\n"); send_reply("403", "Forbidden"); exit; } xlog("L_ERR","VARS: cgrret is $cgrret, rc is $rc\n");
So with a call that should be successful:
May 12 11:44:25 11d5168c-7ddf-4493-fd5c-b3580213f4b5 /usr/sbin/opensips[1601]: VARS: cgrret is 10800, rc is 0
T 127.0.0.1:48080 -> 127.0.0.1:2012 [AP] { "method": "SMGenericV1.GetMaxUsage", "params": [ { "Destination": "441617102180", "RequestType": "*prepaid", "SetupTime": "1494589465", "Category": "call_standard", "OriginID": "1447750095@192.168.1.70", "Account": "9470898910", "Tenant": "rater.sip247.com" } ] }
T 127.0.0.1:2012 -> 127.0.0.1:48080 [AP] {"id":null,"result":10800,"error":null}
Now I change cgr_category to make it fail with rating plan not found:
May 12 11:47:11 11d5168c-7ddf-4493-fd5c-b3580213f4b5 CGRateS
T 127.0.0.1:48116 -> 127.0.0.1:2012 [AP] { "method": "SMGenericV1.GetMaxUsage", "params": [ { "Destination": "441617102180", "RequestType": "*prepaid", "SetupTime": "1494589631", "Category": "call_standard1", "OriginID": "2069630171@192.168.1.70", "Account": "9470898910", "Tenant": "rater.sip247.com" } ] }
T 127.0.0.1:2012 -> 127.0.0.1:48116 [AP] {"id":null,"result":null,"error":"SERVER_ERROR: RATING_PLAN_NOT_FOUND"}
With the following calls still go through despite errors from cgrates:
At this point it looks like $rc = 0 and $cgrret = null