Module: kamailio
Branch: master
Commit: c8306ceb46c201172f84f72e5566922c22578fc2
URL:
https://github.com/kamailio/kamailio/commit/c8306ceb46c201172f84f72e5566922…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-02-08T08:02:49+01:00
influxdb: added missing for sub start and end
---
Modified: src/modules/influxdbc/influxdbc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c8306ceb46c201172f84f72e5566922…
Patch:
https://github.com/kamailio/kamailio/commit/c8306ceb46c201172f84f72e5566922…
---
diff --git a/src/modules/influxdbc/influxdbc_mod.c
b/src/modules/influxdbc/influxdbc_mod.c
index 2c2f8804bb4..0ec502a7d71 100644
--- a/src/modules/influxdbc/influxdbc_mod.c
+++ b/src/modules/influxdbc/influxdbc_mod.c
@@ -47,6 +47,8 @@ static char *_infdbc_tags = NULL;
static int w_influxdbc_measure(sip_msg_t *msg, char *pname, char *p2);
static int w_influxdbc_measureend(sip_msg_t *msg, char *p1, char *p2);
+static int w_influxdbc_sub(sip_msg_t *msg, char *pname, char *p2);
+static int w_influxdbc_subend(sip_msg_t *msg, char *p1, char *p2);
static int w_influxdbc_push(sip_msg_t *msg, char *p1, char *p2);
static int w_influxdbc_long(sip_msg_t *msg, char *pname, char *pvalue);
static int w_influxdbc_string(sip_msg_t *msg, char *pname, char *pvalue);
@@ -62,6 +64,10 @@ static cmd_export_t cmds[] = {
1, fixup_spve_null, 0, ANY_ROUTE},
{"influxdbc_measureend", (cmd_function)w_influxdbc_measureend,
0, 0, 0, ANY_ROUTE},
+ {"influxdbc_sub", (cmd_function)w_influxdbc_sub,
+ 1, fixup_spve_null, 0, ANY_ROUTE},
+ {"influxdbc_subend", (cmd_function)w_influxdbc_subend,
+ 0, 0, 0, ANY_ROUTE},
{"influxdbc_push", (cmd_function)w_influxdbc_push,
0, 0, 0, ANY_ROUTE},
{"influxdbc_long", (cmd_function)w_influxdbc_long,
@@ -169,6 +175,33 @@ static int w_influxdbc_measureend(sip_msg_t *msg, char *p1, char
*p2)
return 1;
}
+/**
+ *
+ */
+static int w_influxdbc_sub(sip_msg_t *msg, char *pname, char *p2)
+{
+ str sname;
+
+ if(fixup_get_svalue(msg, (gparam_t *)pname, &sname) != 0) {
+ LM_ERR("unable to get name parameter\n");
+ return -1;
+ }
+
+ ic_sub(sname.s);
+
+ return 1;
+}
+
+/**
+ *
+ */
+static int w_influxdbc_subend(sip_msg_t *msg, char *p1, char *p2)
+{
+ ic_subend();
+
+ return 1;
+}
+
/**
*
*/