[sr-dev] git:master:8d55e51f: xhttp_pi: export functions to kemi framework

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 31 10:12:30 CET 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-10-31T08:37:51+01:00

xhttp_pi: export functions to kemi framework

---

Modified: src/modules/xcap_server/xcap_server.c
Modified: src/modules/xhttp_pi/xhttp_pi.c

---

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

---

diff --git a/src/modules/xcap_server/xcap_server.c b/src/modules/xcap_server/xcap_server.c
index 3d92ad9c68..578a03b0f7 100644
--- a/src/modules/xcap_server/xcap_server.c
+++ b/src/modules/xcap_server/xcap_server.c
@@ -1714,7 +1714,7 @@ static int check_match_header(str body, str *etag)
 static sr_kemi_t sr_kemi_xcap_server_exports[] = {
 	{ str_init("xcap_server"), str_init("xcaps_put"),
 		SR_KEMIP_INT, ki_xcaps_put,
-		{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_STR,
+		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
 	},
 	{ str_init("xcap_server"), str_init("xcaps_get"),
diff --git a/src/modules/xhttp_pi/xhttp_pi.c b/src/modules/xhttp_pi/xhttp_pi.c
index ac7aaf0a18..dfa28c2035 100644
--- a/src/modules/xhttp_pi/xhttp_pi.c
+++ b/src/modules/xhttp_pi/xhttp_pi.c
@@ -39,6 +39,7 @@
 #include "../../core/nonsip_hooks.h"
 #include "../../modules/xhttp/api.h"
 #include "../../core/rpc_lookup.h"
+#include "../../core/kemi.h"
 #include "xhttp_pi.h"
 #include "xhttp_pi_fnc.h"
 #include "http_db_handler.h"
@@ -87,7 +88,8 @@ int buf_size = 0;
 char error_buf[ERROR_REASON_BUF_LEN];
 
 static cmd_export_t cmds[] = {
-	{"dispatch_xhttp_pi",(cmd_function)xhttp_pi_dispatch,0,0,0,REQUEST_ROUTE},
+	{"dispatch_xhttp_pi",(cmd_function)xhttp_pi_dispatch,0,0,0,
+			REQUEST_ROUTE|EVENT_ROUTE},
 	{0, 0, 0, 0, 0, 0}
 };
 
@@ -309,7 +311,7 @@ int destroy(void)
 }
 
 
-static int xhttp_pi_dispatch(sip_msg_t* msg, char* s1, char* s2)
+static int ki_xhttp_pi_dispatch(sip_msg_t* msg)
 {
 	str arg = {NULL, 0};
 	int ret = 0;
@@ -369,6 +371,10 @@ static int xhttp_pi_dispatch(sip_msg_t* msg, char* s1, char* s2)
 	return 0;
 }
 
+static int xhttp_pi_dispatch(sip_msg_t* msg, char* s1, char* s2)
+{
+	return ki_xhttp_pi_dispatch(msg);
+}
 
 /* rpc function documentation */
 static const char *rpc_reload_doc[2] = {
@@ -392,3 +398,26 @@ static rpc_export_t rpc_methods[] = {
 	{0, 0, 0, 0}
 };
 
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_xhttp_pi_exports[] = {
+	{ str_init("xhttp_pi"), str_init("dispatch"),
+		SR_KEMIP_INT, ki_xhttp_pi_dispatch,
+		{ 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_xhttp_pi_exports);
+	return 0;
+}
\ No newline at end of file




More information about the sr-dev mailing list