[sr-dev] git:master:8201472d: pua_usrloc: exported functions to kemi framework

Daniel-Constantin Mierla miconda at gmail.com
Sat Apr 29 11:29:17 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-04-29T08:33:07+02:00

pua_usrloc: exported functions to kemi framework

---

Modified: src/modules/pua_usrloc/pua_usrloc.c
Modified: src/modules/pua_usrloc/pua_usrloc.h
Modified: src/modules/pua_usrloc/ul_publish.c

---

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

---

diff --git a/src/modules/pua_usrloc/pua_usrloc.c b/src/modules/pua_usrloc/pua_usrloc.c
index b393ef2..66a1450 100644
--- a/src/modules/pua_usrloc/pua_usrloc.c
+++ b/src/modules/pua_usrloc/pua_usrloc.c
@@ -44,6 +44,7 @@
 #include "../../core/str.h"
 #include "../../core/mem/mem.h"
 #include "../../core/pt.h"
+#include "../../core/kemi.h"
 #include "../usrloc/usrloc_mod.h"
 #include "../usrloc/usrloc.h"
 #include "../usrloc/ul_callback.h"
@@ -69,11 +70,9 @@ usrloc_api_t ul;
 
 static int mod_init(void);
 
-int pua_set_publish(struct sip_msg* , char*, char*);
-
 static cmd_export_t cmds[]=
 {
-	{"pua_set_publish", (cmd_function)pua_set_publish, 0, 0, 0, REQUEST_ROUTE},
+	{"pua_set_publish", (cmd_function)w_pua_set_publish, 0, 0, 0, REQUEST_ROUTE},
 	{"bind_pua_usrloc", (cmd_function)bind_pua_usrloc, 1, 0, 0, 0},
 	{0, 0, 0, 0, 0, 0}
 };
@@ -204,6 +203,30 @@ int bind_pua_usrloc(struct pua_usrloc_binds *pxb)
 		return -1;
 	}
 
-	pxb->pua_set_publish = pua_set_publish;
+	pxb->pua_set_publish = w_pua_set_publish;
 	return 0;
 }
+
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_pua_usrloc_exports[] = {
+	{ str_init("pua"), str_init("pua_set_publish"),
+		SR_KEMIP_INT, ki_pua_set_publish,
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+	},
+
+	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+/* clang-format on */
+
+/**
+ *
+ */
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
+{
+	sr_kemi_modules_add(sr_kemi_pua_usrloc_exports);
+	return 0;
+}
\ No newline at end of file
diff --git a/src/modules/pua_usrloc/pua_usrloc.h b/src/modules/pua_usrloc/pua_usrloc.h
index 89ceee5..93a918c 100644
--- a/src/modules/pua_usrloc/pua_usrloc.h
+++ b/src/modules/pua_usrloc/pua_usrloc.h
@@ -33,6 +33,8 @@
 #include "../pua/pua_bind.h"
 
 void ul_publish(ucontact_t* c, int type, void* param);
+int w_pua_set_publish(sip_msg_t*, char*, char*);
+int ki_pua_set_publish(sip_msg_t*);
 int pua_unset_publish(struct sip_msg* msg, unsigned int flags, void* param);
 
 extern str pres_prefix;
diff --git a/src/modules/pua_usrloc/ul_publish.c b/src/modules/pua_usrloc/ul_publish.c
index 59417c2..14b318f 100644
--- a/src/modules/pua_usrloc/ul_publish.c
+++ b/src/modules/pua_usrloc/ul_publish.c
@@ -45,7 +45,7 @@
 #include "pua_usrloc.h"
 
 #define BUF_LEN   256
-int pua_set_publish(struct sip_msg* msg , char* s1, char* s2)
+int ki_pua_set_publish(sip_msg_t* msg)
 {
 	LM_DBG("set send publish\n");
 	pua_ul_publish= 1;
@@ -54,6 +54,11 @@ int pua_set_publish(struct sip_msg* msg , char* s1, char* s2)
 	return 1;
 }
 
+int w_pua_set_publish(struct sip_msg* msg , char* s1, char* s2)
+{
+	return ki_pua_set_publish(msg);
+}
+
 int pua_unset_publish(struct sip_msg* msg, unsigned int flags, void* param)
 {
 	pua_ul_publish= 0;




More information about the sr-dev mailing list