Browse code

topos: init xavp and context modparams to str null

(cherry picked from commit 5e3f7e1557d90a3e6f40eff41cc0b0bb317ab544)

Daniel-Constantin Mierla authored on 13/05/2021 15:53:18
Showing 1 changed files
... ...
@@ -107,13 +107,13 @@ str _tps_contact_host = str_init("");
107 107
 int _tps_contact_mode = 0;
108 108
 str _tps_cparam_name = str_init("tps");
109 109
 
110
-str _tps_xavu_cfg = str_init("");
111
-str _tps_xavu_field_acontact = str_init("");
112
-str _tps_xavu_field_bcontact = str_init("");
113
-str _tps_xavu_field_contact_host = str_init("");
110
+str _tps_xavu_cfg = STR_NULL;
111
+str _tps_xavu_field_acontact = STR_NULL;
112
+str _tps_xavu_field_bcontact = STR_NULL;
113
+str _tps_xavu_field_contact_host = STR_NULL;
114 114
 
115
-str _tps_context_param = str_init("");
116
-str _tps_context_value = str_init("");
115
+str _tps_context_param = STR_NULL;
116
+str _tps_context_value = STR_NULL;
117 117
 
118 118
 sanity_api_t scb;
119 119
 
... ...
@@ -247,7 +247,8 @@ static int mod_init(void)
247 247
 	if(sruid_init(&_tps_sruid, '-', "tpsh", SRUID_INC)<0)
248 248
 		return -1;
249 249
 
250
-	if (_tps_contact_mode == 2 && (_tps_xavu_field_acontact.len <= 0
250
+	if (_tps_contact_mode == 2 && (_tps_xavu_cfg.len <= 0
251
+				|| _tps_xavu_field_acontact.len <= 0
251 252
 				|| _tps_xavu_field_bcontact.len <= 0)) {
252 253
 		LM_ERR("contact_mode parameter is 2,"
253 254
 				" but a_contact or b_contact xavu fields not defined\n");