Module: kamailio
Branch: master
Commit: c86b882087b6fa9b45f70715c4178178a0086804
URL:
https://github.com/kamailio/kamailio/commit/c86b882087b6fa9b45f70715c417817…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-04-14T17:50:14+02:00
kex: exported setdebug() and resetdebug() to kemi framework
---
Modified: src/modules/kex/kex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c86b882087b6fa9b45f70715c417817…
Patch:
https://github.com/kamailio/kamailio/commit/c86b882087b6fa9b45f70715c417817…
---
diff --git a/src/modules/kex/kex_mod.c b/src/modules/kex/kex_mod.c
index 9af58c6..46bc97a 100644
--- a/src/modules/kex/kex_mod.c
+++ b/src/modules/kex/kex_mod.c
@@ -32,6 +32,7 @@
#include "../../core/flags.h"
#include "../../core/dset.h"
#include "../../core/mod_fix.h"
+#include "../../core/kemi.h"
#include "../../core/parser/parse_uri.h"
#include "../../lib/srutils/sruid.h"
@@ -233,3 +234,49 @@ static int pv_get_sruid_val(struct sip_msg *msg, pv_param_t *param,
return pv_get_strval(msg, param, res, &_kex_sruid.uid);
}
+/**
+ *
+ */
+static int ki_kex_setdebug(sip_msg_t *msg, int lval)
+{
+ set_local_debug_level(lval);
+ return 1;
+}
+
+/**
+ *
+ */
+static int ki_kex_resetdebug(sip_msg_t *msg)
+{
+ reset_local_debug_level();
+ return 1;
+}
+
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_kex_exports[] = {
+ { str_init("kex"), str_init("setdebug"),
+ SR_KEMIP_INT, ki_kex_setdebug,
+ { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("kex"), str_init("resetdebug"),
+ SR_KEMIP_INT, ki_kex_resetdebug,
+ { SR_KEMIP_STR, SR_KEMIP_STR, 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_kex_exports);
+ return 0;
+}
\ No newline at end of file