Module: kamailio Branch: master Commit: f0293351591d7751def6768ba716ba98faa1154b URL: https://github.com/kamailio/kamailio/commit/f0293351591d7751def6768ba716ba98...
Author: jaybeepee jason.penton@gmail.com Committer: GitHub noreply@github.com Date: 2016-07-25T09:24:29+02:00
Merge pull request #722 from athonet-open/ims_charging_fix_ro_issues
ims_charging: fix Ro issues
---
Modified: modules/ims_charging/ccr.c Modified: modules/ims_charging/ims_ro.c Modified: modules/ims_charging/ro_session_hash.c Modified: modules/ims_charging/ro_timer.c
---
Diff: https://github.com/kamailio/kamailio/commit/f0293351591d7751def6768ba716ba98... Patch: https://github.com/kamailio/kamailio/commit/f0293351591d7751def6768ba716ba98...
---
diff --git a/modules/ims_charging/ccr.c b/modules/ims_charging/ccr.c index a2fa489..82e5ae8 100644 --- a/modules/ims_charging/ccr.c +++ b/modules/ims_charging/ccr.c @@ -21,7 +21,7 @@ int Ro_write_event_type_avps(AAA_AVP_LIST * avp_list, event_type_t * x) { goto error;
if (x->expires) - if (!cdp_avp->epcapp.add_Expires(avp_list, *(x->expires))) + if (!cdp_avp->epcapp.add_Expires(&aList, *(x->expires))) goto error;
if (!cdp_avp->epcapp.add_Event_Type(avp_list, &aList, AVP_FREE_DATA)) //TODO: used to be DONT FREE diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c index df56bad..c0c586f 100644 --- a/modules/ims_charging/ims_ro.c +++ b/modules/ims_charging/ims_ro.c @@ -638,6 +638,7 @@ void send_ccr_interim(struct ro_session* ro_session, unsigned int used, unsigned }
if (ret != 1) { + ccr = 0; // If an error is returned from cdp AAASendMessage, the message has been freed there goto error; } // cdpb.AAASessionsUnlock(auth->hash); diff --git a/modules/ims_charging/ro_session_hash.c b/modules/ims_charging/ro_session_hash.c index d63697d..3967b0c 100644 --- a/modules/ims_charging/ro_session_hash.c +++ b/modules/ims_charging/ro_session_hash.c @@ -220,7 +220,7 @@ struct ro_session* build_new_ro_session(int direction, int auth_appid, int auth_ new_ro_session->reserved_secs = requested_secs; new_ro_session->valid_for = validity_timeout;
- new_ro_session->hop_by_hop = 1; + new_ro_session->hop_by_hop = 0; new_ro_session->next = 0; new_ro_session->dlg_h_entry = dlg_h_entry; new_ro_session->dlg_h_id = dlg_h_id; diff --git a/modules/ims_charging/ro_timer.c b/modules/ims_charging/ro_timer.c index ded2a4b..57bf55c 100644 --- a/modules/ims_charging/ro_timer.c +++ b/modules/ims_charging/ro_timer.c @@ -280,7 +280,7 @@ void resume_ro_session_ontimeout(struct interim_ccr *i_req, int timeout_or_error used_secs = rint((now - ((timeout_or_error==1 && i_req->ro_session->last_event_timestamp_backup>0)?i_req->ro_session->last_event_timestamp_backup : i_req->ro_session->last_event_timestamp)) / (float) 1000000);
/* check to make sure diameter server is giving us sane values */ - if (i_req->new_credit > i_req->credit_valid_for) { + if (i_req->credit_valid_for !=0 && i_req->new_credit > i_req->credit_valid_for) { LM_WARN("That's weird, Diameter server gave us credit with a lower validity period :D. Setting reserved time to validity period instead \n"); i_req->new_credit = i_req->credit_valid_for; } @@ -473,6 +473,9 @@ void ro_session_ontimeout(struct ro_tl *tl) { case delayed_delete: destroy_ro_session(ro_session); return; + case pending: + /* call is not answered yet. No point asking more credit. Just wait for dialog to progress somehow */ + return; default: LM_ERR("Diameter call session - event [%d]\n", ro_session->event_type);