|
@@ -24,6 +24,7 @@
|
|
|
#include "isup_parsed.h"
|
|
|
#include "../../core/sr_module.h"
|
|
|
#include "../../core/endianness.h"
|
|
|
+#include "../../core/kemi.h"
|
|
|
|
|
|
MODULE_VERSION
|
|
|
|
|
@@ -315,10 +316,9 @@ static uint8_t *fetch_payload(struct sip_msg *_m, char *pname, int *len)
|
|
|
return (uint8_t *) pt.rs.s;
|
|
|
}
|
|
|
|
|
|
-static int w_isup_to_json(struct sip_msg *_m, char *param1, char *param2)
|
|
|
+static int ki_isup_to_json(sip_msg_t *_m, int proto)
|
|
|
{
|
|
|
struct isup_state isup_state = { 0, };
|
|
|
- int proto = atoi(param1);
|
|
|
const uint8_t *data;
|
|
|
int opc, dpc, mtp_type, int_len, rc;
|
|
|
size_t len;
|
|
@@ -372,6 +372,11 @@ static int w_isup_to_json(struct sip_msg *_m, char *param1, char *param2)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+static int w_isup_to_json(struct sip_msg *_m, char *param1, char *param2)
|
|
|
+{
|
|
|
+ return ki_isup_to_json(_m, atoi(param1));
|
|
|
+}
|
|
|
+
|
|
|
#define UINT_OR_NULL(msg, param, res, node) \
|
|
|
node ? pv_get_uintval(msg, param, res, node->valuedouble) : pv_get_null(msg, param, res)
|
|
|
|
|
@@ -716,3 +721,27 @@ error:
|
|
|
LM_ERR("unknown isup input %.*s\n", in->len, in->s);
|
|
|
return -1;
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+/* clang-format off */
|
|
|
+static sr_kemi_t sr_kemi_ss7ops_exports[] = {
|
|
|
+ { str_init("ss7ops"), str_init("isup_to_json"),
|
|
|
+ SR_KEMIP_INT, ki_isup_to_json,
|
|
|
+ { SR_KEMIP_INT, 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_ss7ops_exports);
|
|
|
+ return 0;
|
|
|
+}
|