Module: kamailio Branch: master Commit: 5844207ce42ef830fe560e408c6e807184c8d31e URL: https://github.com/kamailio/kamailio/commit/5844207ce42ef830fe560e408c6e8071...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-02-08T16:31:19+01:00
influxdbc: functions for kemi framework
---
Modified: src/modules/influxdbc/influxdbc_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/5844207ce42ef830fe560e408c6e8071... Patch: https://github.com/kamailio/kamailio/commit/5844207ce42ef830fe560e408c6e8071...
---
diff --git a/src/modules/influxdbc/influxdbc_mod.c b/src/modules/influxdbc/influxdbc_mod.c index 0ec502a7d71..90f6107ac68 100644 --- a/src/modules/influxdbc/influxdbc_mod.c +++ b/src/modules/influxdbc/influxdbc_mod.c @@ -165,6 +165,16 @@ static int w_influxdbc_measure(sip_msg_t *msg, char *pname, char *p2) return 1; }
+/** + * + */ +static int ki_influxdbc_measure(sip_msg_t *msg, str *name) +{ + ic_measure(name->s); + + return 1; +} + /** * */ @@ -175,6 +185,16 @@ static int w_influxdbc_measureend(sip_msg_t *msg, char *p1, char *p2) return 1; }
+/** + * + */ +static int ki_influxdbc_measureend(sip_msg_t *msg) +{ + ic_measureend(); + + return 1; +} + /** * */ @@ -212,6 +232,16 @@ static int w_influxdbc_push(sip_msg_t *msg, char *p1, char *p2) return 1; }
+/** + * + */ +static int ki_influxdbc_push(sip_msg_t *msg) +{ + ic_push(); + + return 1; +} + /** * */ @@ -234,6 +264,16 @@ static int w_influxdbc_long(sip_msg_t *msg, char *pname, char *pvalue) return 1; }
+/** + * + */ +static int ki_influxdbc_long(sip_msg_t *msg, str *name, int val) +{ + ic_long(name->s, val); + + return 1; +} + /** * */ @@ -288,6 +328,27 @@ static int w_influxdbc_double(sip_msg_t *msg, char *pname, char *pvalue) */ /* clang-format off */ static sr_kemi_t sr_kemi_influxdbc_exports[] = { + { str_init("influxdbc"), str_init("measure"), + SR_KEMIP_INT, ki_influxdbc_measure, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("influxdbc"), str_init("measureend"), + SR_KEMIP_INT, ki_influxdbc_measureend, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("influxdbc"), str_init("ic_long"), + SR_KEMIP_INT, ki_influxdbc_long, + { SR_KEMIP_STR, SR_KEMIP_INT, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("influxdbc"), str_init("push"), + SR_KEMIP_INT, ki_influxdbc_push, + { 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 */