[sr-dev] git:master:f0e0a849: presence_xml: do not include ../presence/presence.h

Daniel-Constantin Mierla miconda at gmail.com
Sun Jan 13 11:36:22 CET 2019


Module: kamailio
Branch: master
Commit: f0e0a849f5dfe5dae0cd0e755b9739cbc7fa8200
URL: https://github.com/kamailio/kamailio/commit/f0e0a849f5dfe5dae0cd0e755b9739cbc7fa8200

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-01-13T11:34:25+01:00

presence_xml: do not include ../presence/presence.h

- it is not needed, that header file is related to modparams of presence
module
- renamed db_url to presxml_db_url just to avoid possible conflict in
the future like for GH #1809

---

Modified: src/modules/presence_xml/presence_xml.c
Modified: src/modules/presence_xml/presence_xml.h

---

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

---

diff --git a/src/modules/presence_xml/presence_xml.c b/src/modules/presence_xml/presence_xml.c
index 36995c8b3c..228896c18a 100644
--- a/src/modules/presence_xml/presence_xml.c
+++ b/src/modules/presence_xml/presence_xml.c
@@ -81,7 +81,7 @@ pres_get_sphere_t pres_get_sphere;
 
 /* Module parameter variables */
 str xcap_table= str_init("xcap");
-str db_url = str_init(DEFAULT_DB_URL);
+static str presxml_db_url = str_init(DEFAULT_DB_URL);
 int force_active= 0;
 int force_dummy_presence = 0;
 int integrated_xcap_server= 0;
@@ -115,7 +115,7 @@ static cmd_export_t cmds[]={
 };
 
 static param_export_t params[]={
-	{ "db_url",		PARAM_STR, &db_url},
+	{ "db_url",		PARAM_STR, &presxml_db_url},
 	{ "xcap_table",		PARAM_STR, &xcap_table},
 	{ "force_active",	INT_PARAM, &force_active },
 	{ "integrated_xcap_server", INT_PARAM, &integrated_xcap_server},
@@ -156,7 +156,8 @@ static int mod_init(void)
 	if(passive_mode==1)
 		return 0;
 
-	LM_DBG("db_url=%s/%d/%p\n",ZSW(db_url.s),db_url.len, db_url.s);
+	LM_DBG("db_url=%s (len=%d addr=%p)\n", ZSW(presxml_db_url.s),
+			presxml_db_url.len, presxml_db_url.s);
 
 	/* bind the SL API */
 	if (sl_load_api(&slb)!=0) {
@@ -196,7 +197,7 @@ static int mod_init(void)
 	if(force_active== 0)
 	{
 		/* binding to mysql module  */
-		if (db_bind_mod(&db_url, &pxml_dbf))
+		if (db_bind_mod(&presxml_db_url, &pxml_dbf))
 		{
 			LM_ERR("Database module not found\n");
 			return -1;
@@ -208,7 +209,7 @@ static int mod_init(void)
 			return -1;
 		}
 
-		pxml_db = pxml_dbf.init(&db_url);
+		pxml_db = pxml_dbf.init(&presxml_db_url);
 		if (!pxml_db)
 		{
 			LM_ERR("while connecting to database\n");
@@ -284,7 +285,7 @@ static int child_init(int rank)
 	{
 		if(pxml_db)
 			return 0;
-		pxml_db = pxml_dbf.init(&db_url);
+		pxml_db = pxml_dbf.init(&presxml_db_url);
 		if (pxml_db== NULL)
 		{
 			LM_ERR("while connecting database\n");
diff --git a/src/modules/presence_xml/presence_xml.h b/src/modules/presence_xml/presence_xml.h
index 7b523ef028..e165852684 100644
--- a/src/modules/presence_xml/presence_xml.h
+++ b/src/modules/presence_xml/presence_xml.h
@@ -35,7 +35,6 @@
 #include "../../lib/srdb1/db.h"
 #include "../../modules/sl/sl.h"
 #include "../presence/event_list.h"
-#include "../presence/presence.h"
 #include "../presence/presentity.h"
 #include "../xcap_client/xcap_functions.h"
 




More information about the sr-dev mailing list