[sr-dev] git:master:28f00b44: keepalive: use dedicated wrappers for kemi exports

Daniel-Constantin Mierla miconda at gmail.com
Thu Jan 9 17:10:08 CET 2020


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-01-09T17:09:28+01:00

keepalive: use dedicated wrappers for kemi exports

---

Modified: src/modules/keepalive/keepalive_mod.c

---

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

---

diff --git a/src/modules/keepalive/keepalive_mod.c b/src/modules/keepalive/keepalive_mod.c
index 8355b6c4f9..3a10a44868 100644
--- a/src/modules/keepalive/keepalive_mod.c
+++ b/src/modules/keepalive/keepalive_mod.c
@@ -188,6 +188,18 @@ static int w_add_destination(sip_msg_t *msg, char *uri, char *owner)
 
 	return ka_add_dest(&suri, &sowner, 0, 0, 0);
 }
+
+/*!
+ *
+ */
+static int ki_add_destination(sip_msg_t *msg, str *uri, str *owner)
+{
+	if(ka_alloc_destinations_list() < 0)
+		return -1;
+
+	return ka_add_dest(uri, owner, 0, 0, 0);
+}
+
 /*!
 * @function w_del_destination_f
 * @abstract deletes given sip uri in allocated destination stack as named ka_alloc_destinations_list
@@ -214,6 +226,14 @@ static int w_del_destination(sip_msg_t *msg, char *uri, char *owner)
 	return ka_del_destination(&suri, &sowner);
 }
 
+/*!
+ *
+ */
+static int ki_del_destination(sip_msg_t *msg, str *uri, str *owner)
+{
+	return ka_del_destination(uri, owner);
+}
+
 /*
  * Function callback executer per module param "destination".
  * Is just a wrapper to ka_add_dest() api function
@@ -290,12 +310,12 @@ static sr_kemi_t sr_kemi_keepalive_exports[] = {
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
 	},
 	{ str_init("keepalive"), str_init("add_destination"),
-		SR_KEMIP_INT, ka_add_dest,
-		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_INT,
-			SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }
+		SR_KEMIP_INT, ki_add_destination,
+		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
 	},
 	{ str_init("keepalive"), str_init("del_destination"),
-		SR_KEMIP_INT, ka_del_destination,
+		SR_KEMIP_INT, ki_del_destination,
 		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
 	},




More information about the sr-dev mailing list