Skip to content

Commit

Permalink
cgrates: don't divide MaxUsage for postpaid
Browse files Browse the repository at this point in the history
Do not divde MaxUsage 0 and -1 values with 10000000 when postpaid is
used, otherwise we will get invalid values and the session is
immediately closed.

Thanks to TeoV (Teofil Voivozeanu) and DanB (Dan Bogos) for reporting
and testing
  • Loading branch information
razvancrainea committed Apr 26, 2018
1 parent ecb29ab commit ba938dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/cgrates/cgrates_acc.c
Expand Up @@ -220,7 +220,9 @@ static int cgr_proc_start_acc_reply(struct cgr_conn *c, json_object *jobj,
json_object_get_type(jobj), json_object_to_json_string(jobj));
return -4;
}
val.n = json_object_get_int64(jobj) / 1000000000;
val.n = json_object_get_int64(jobj);
if (val.n != 0 && val.n != -1)
val.n /= 1000000000;
} else {
if (json_object_get_type(jobj) != json_type_int) {
LM_ERR("CGRateS returned a non-int type for InitiateSession reply: %d %s\n",
Expand Down

0 comments on commit ba938dc

Please sign in to comment.