Преглед изворни кода

ims_charging: Only send CCR_STOP, if we've had a positive reply for CCR_START

Carsten Bock пре 10 година
родитељ
комит
34efdc9c4f
2 измењених фајлова са 6 додато и 3 уклоњено
  1. 5 3
      modules/ims_charging/dialog.c
  2. 1 0
      modules/ims_charging/ro_session_hash.h

+ 5 - 3
modules/ims_charging/dialog.c

@@ -164,9 +164,11 @@ void dlg_terminated(struct dlg_cell *dlg, int type, struct dlg_cb_params *_param
 					}
 				}
 
-				LM_DBG("Sending CCR STOP on Ro_Session [%p]\n", ro_session);
-				send_ccr_stop(ro_session);
-				ro_session->active = 0;
+				if (ro_session->event_type != unknown) {
+					LM_DBG("Sending CCR STOP on Ro_Session [%p], as it is in '%d' state\n", ro_session, ro_session->event_type);
+					send_ccr_stop(ro_session);
+					ro_session->active = 0;
+				}
 				
 				if (ro_db_mode == DB_MODE_REALTIME) {
 				    ro_session->flags |= RO_SESSION_FLAG_DELETED;

+ 1 - 0
modules/ims_charging/ro_session_hash.h

@@ -23,6 +23,7 @@
 #define MAX_PANI_LEN 100
 
 enum ro_session_event_type {
+    unknown = 0,
     pending,
     answered,
     no_more_credit,