2
0
Эх сурвалжийг харах

acc: added acc_prepare_flag parameter

- useful to tell to acc module to prepare the request for later
  accounting, in case the acc or missed call flag is not set in request
  route block at all. Otherwise there will be no accounting if the acc
  flags are set for first time in TM routes (e.g., like failure_route)
- dicovered in a discussion with Ozren Lapcevic
Daniel-Constantin Mierla 14 жил өмнө
parent
commit
cf7a3249f9

+ 4 - 1
modules_k/acc/acc_logic.c

@@ -100,6 +100,8 @@ struct acc_enviroment acc_env;
 #define skip_cancel(_rq) \
 	(((_rq)->REQ_METHOD==METHOD_CANCEL) && report_cancels==0)
 
+#define is_acc_prepare_on(_rq) \
+	(is_acc_flag_set(_rq,acc_prepare_flag))
 
 
 
@@ -228,7 +230,8 @@ void acc_onreq( struct cell* t, int type, struct tmcb_params *ps )
 	int is_invite;
 
 	if ( ps->req && !skip_cancel(ps->req) &&
-	(is_acc_on(ps->req) || is_mc_on(ps->req)) ) {
+			( is_acc_on(ps->req) || is_mc_on(ps->req)
+				|| is_acc_prepare_on(ps->req) ) ) {
 		/* do some parsing in advance */
 		if (acc_preparse_req(ps->req)<0)
 			return;

+ 2 - 0
modules_k/acc/acc_mod.c

@@ -108,6 +108,7 @@ static char *failed_filter_str = 0;  /* by default, do not filter logging of
 unsigned short failed_filter[MAX_FAILED_FILTER_COUNT + 1];
 static char* leg_info_str = 0;	/*!< multi call-leg support */
 struct acc_extra *leg_info = 0;
+int acc_prepare_flag = -1; /*!< should the request be prepared for later acc */
 
 
 /* ----- SYSLOG acc variables ----------- */
@@ -236,6 +237,7 @@ static param_export_t params[] = {
 	{"report_cancels",          INT_PARAM, &report_cancels          },
 	{"multi_leg_info",          STR_PARAM, &leg_info_str            },
 	{"detect_direction",        INT_PARAM, &detect_direction        },
+	{"acc_prepare_flag",        INT_PARAM, &acc_prepare_flag        },
 	/* syslog specific */
 	{"log_flag",             INT_PARAM, &log_flag             },
 	{"log_missed_flag",      INT_PARAM, &log_missed_flag      },

+ 1 - 0
modules_k/acc/acc_mod.h

@@ -49,6 +49,7 @@ extern int early_media;
 extern int failed_transaction_flag;
 extern unsigned short failed_filter[];
 extern int detect_direction;
+extern int acc_prepare_flag;
 
 extern int log_facility;
 extern int log_level;