Module: kamailio
Branch: master
Commit: f5c3d50d94ef92dfc82fdbbdf301ce5e79091c38
URL:
https://github.com/kamailio/kamailio/commit/f5c3d50d94ef92dfc82fdbbdf301ce5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-04-14T09:07:39+02:00
jsonrpcs: exported jsonrpc_exec() to kemi framework
- available as jsonrpcs.exec()
---
Modified: src/modules/jsonrpcs/jsonrpcs_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f5c3d50d94ef92dfc82fdbbdf301ce5…
Patch:
https://github.com/kamailio/kamailio/commit/f5c3d50d94ef92dfc82fdbbdf301ce5…
---
diff --git a/src/modules/jsonrpcs/jsonrpcs_mod.c b/src/modules/jsonrpcs/jsonrpcs_mod.c
index 34f5f64..7e05029 100644
--- a/src/modules/jsonrpcs/jsonrpcs_mod.c
+++ b/src/modules/jsonrpcs/jsonrpcs_mod.c
@@ -45,6 +45,7 @@
#include "../../core/sip_msg_clone.h"
#include "../../core/data_lump.h"
#include "../../core/data_lump_rpl.h"
+#include "../../core/kemi.h"
#include "../../modules/xhttp/api.h"
#include "jsonrpcs_mod.h"
@@ -1445,3 +1446,35 @@ static int jsonrpc_pv_parse_jrpl_name(pv_spec_t *sp, str *in)
}
return 0;
}
+
+/**
+ *
+ */
+static int ki_jsonrpcs_exec(sip_msg_t *msg, str *scmd)
+{
+ return jsonrpc_exec_ex(scmd, NULL);
+}
+
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_jsonrpcs_exports[] = {
+ { str_init("jsonrpcs"), str_init("exec"),
+ SR_KEMIP_INT, ki_jsonrpcs_exec,
+ { SR_KEMIP_STR, 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_jsonrpcs_exports);
+ return 0;
+}