[sr-dev] git:master:8577eb15: statsc: exported functions to kemi interface

Daniel-Constantin Mierla miconda at gmail.com
Wed May 3 08:38:13 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-05-03T08:23:25+02:00

statsc: exported functions to kemi interface

---

Modified: src/modules/statsc/statsc_mod.c

---

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

---

diff --git a/src/modules/statsc/statsc_mod.c b/src/modules/statsc/statsc_mod.c
index cc25b2f..77c112b 100644
--- a/src/modules/statsc/statsc_mod.c
+++ b/src/modules/statsc/statsc_mod.c
@@ -31,6 +31,7 @@
 #include "../../core/timer_proc.h"
 #include "../../core/rpc.h"
 #include "../../core/rpc_lookup.h"
+#include "../../core/kemi.h"
 
 #include "../../core/parser/parse_param.h"
 
@@ -119,11 +120,20 @@ static void mod_destroy(void)
 /**
  *
  */
-static int w_statsc_reset(sip_msg_t* msg, char* p1, char* p2)
+static int ki_statsc_reset(sip_msg_t* msg)
 {
+	LM_ERR("not implemented yet\n");
 	return 1;
 }
 
+/**
+ *
+ */
+static int w_statsc_reset(sip_msg_t* msg, char* p1, char* p2)
+{
+	return ki_statsc_reset(msg);
+}
+
 typedef int (*statsc_func_t)(void *p, int64_t *res);
 
 typedef struct statsc_nmap {
@@ -473,3 +483,26 @@ int statsc_init_rpc(void)
 	return 0;
 }
 
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_statsc_exports[] = {
+	{ str_init("statsc"), str_init("statsc_reset"),
+		SR_KEMIP_INT, ki_statsc_reset,
+		{ 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_statsc_exports);
+	return 0;
+}
\ No newline at end of file




More information about the sr-dev mailing list