[sr-dev] git:5.5:d2fd064a: topos: init xavp and context modparams to str null

Daniel-Constantin Mierla miconda at gmail.com
Thu May 13 18:02:29 CEST 2021


Module: kamailio
Branch: 5.5
Commit: d2fd064af771df2ffe6c7a78c05d75facdfa50bf
URL: https://github.com/kamailio/kamailio/commit/d2fd064af771df2ffe6c7a78c05d75facdfa50bf

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-05-13T17:55:14+02:00

topos: init xavp and context modparams to str null

(cherry picked from commit 5e3f7e1557d90a3e6f40eff41cc0b0bb317ab544)

---

Modified: src/modules/topos/topos_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/d2fd064af771df2ffe6c7a78c05d75facdfa50bf.diff
Patch: https://github.com/kamailio/kamailio/commit/d2fd064af771df2ffe6c7a78c05d75facdfa50bf.patch

---

diff --git a/src/modules/topos/topos_mod.c b/src/modules/topos/topos_mod.c
index ba58920a6c..498cc8defe 100644
--- a/src/modules/topos/topos_mod.c
+++ b/src/modules/topos/topos_mod.c
@@ -107,13 +107,13 @@ str _tps_contact_host = str_init("");
 int _tps_contact_mode = 0;
 str _tps_cparam_name = str_init("tps");
 
-str _tps_xavu_cfg = str_init("");
-str _tps_xavu_field_acontact = str_init("");
-str _tps_xavu_field_bcontact = str_init("");
-str _tps_xavu_field_contact_host = str_init("");
+str _tps_xavu_cfg = STR_NULL;
+str _tps_xavu_field_acontact = STR_NULL;
+str _tps_xavu_field_bcontact = STR_NULL;
+str _tps_xavu_field_contact_host = STR_NULL;
 
-str _tps_context_param = str_init("");
-str _tps_context_value = str_init("");
+str _tps_context_param = STR_NULL;
+str _tps_context_value = STR_NULL;
 
 sanity_api_t scb;
 
@@ -247,7 +247,8 @@ static int mod_init(void)
 	if(sruid_init(&_tps_sruid, '-', "tpsh", SRUID_INC)<0)
 		return -1;
 
-	if (_tps_contact_mode == 2 && (_tps_xavu_field_acontact.len <= 0
+	if (_tps_contact_mode == 2 && (_tps_xavu_cfg.len <= 0
+				|| _tps_xavu_field_acontact.len <= 0
 				|| _tps_xavu_field_bcontact.len <= 0)) {
 		LM_ERR("contact_mode parameter is 2,"
 				" but a_contact or b_contact xavu fields not defined\n");




More information about the sr-dev mailing list