Browse code

uac(k): new paramter restore_dlg

- if set to 1, then the module uses dialog variables to store the
initial and new values for From/To headers
- default set to 0 - otherwise all calls that have changes to From/To
headers must be tracked by dialog
- result of checking a report from Alex Balashov

Daniel-Constantin Mierla authored on 02/10/2012 19:50:59
Showing 1 changed files
... ...
@@ -74,6 +74,7 @@ unsigned short restore_from_avp_type;
74 74
 int_str restore_from_avp_name;
75 75
 unsigned short restore_to_avp_type;
76 76
 int_str restore_to_avp_name;
77
+static int uac_restore_dlg = 0;
77 78
 
78 79
 /* global param variables */
79 80
 str rr_from_param = str_init("vsf");
... ...
@@ -146,6 +147,7 @@ static param_export_t params[] = {
146 147
 	{"rr_from_store_param", STR_PARAM,				&rr_from_param.s       },
147 148
 	{"rr_to_store_param",   STR_PARAM,				&rr_to_param.s       },
148 149
 	{"restore_mode",        STR_PARAM,				&restore_mode_str      },
150
+	{"restore_dlg",         INT_PARAM,				&uac_restore_dlg       },
149 151
 	{"restore_passwd",      STR_PARAM,				&uac_passwd.s          },
150 152
 	{"restore_from_avp",	STR_PARAM,				&restore_from_avp.s },
151 153
 	{"restore_to_avp",		STR_PARAM,				&restore_to_avp.s },
... ...
@@ -290,13 +292,14 @@ static int mod_init(void)
290 292
 			/* we need the append_fromtag on in RR */
291 293
 
292 294
 			memset(&dlg_api, 0, sizeof(struct dlg_binds));
293
-			if (load_dlg_api(&dlg_api)!=0) {
295
+			if (uac_restore_dlg==0 || load_dlg_api(&dlg_api)!=0) {
294 296
 				if (!uac_rrb.append_fromtag) {
295 297
 					LM_ERR("'append_fromtag' RR param is not enabled!"
296 298
 						" - required by AUTO restore mode\n");
297 299
 					goto error;
298 300
 				}
299
-				LM_DBG("failed to find dialog API - is dialog module loaded?\n");
301
+				if (uac_restore_dlg!=0)
302
+					LM_DBG("failed to find dialog API - is dialog module loaded?\n");
300 303
 			}
301 304
 
302 305
 			/* get all requests doing loose route */