Module: kamailio
Branch: master
Commit: 704c7f490adc519038d5c2fbb31dd019cc221566
URL:
https://github.com/kamailio/kamailio/commit/704c7f490adc519038d5c2fbb31dd01…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-01-22T17:40:19+01:00
sipdump: kemi functions to return buf and tag values
---
Modified: src/modules/sipdump/sipdump_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/704c7f490adc519038d5c2fbb31dd01…
Patch:
https://github.com/kamailio/kamailio/commit/704c7f490adc519038d5c2fbb31dd01…
---
diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c
index cbb3dfe8aa..1b77d13508 100644
--- a/src/modules/sipdump/sipdump_mod.c
+++ b/src/modules/sipdump/sipdump_mod.c
@@ -467,6 +467,43 @@ int sipdump_msg_sent(sr_event_param_t *evp)
return 0;
}
+/**
+ *
+ */
+static sr_kemi_xval_t _ksr_kemi_sipdump_xval = {0};
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_sipdump_get_buf(sip_msg_t *msg)
+{
+ memset(&_ksr_kemi_sipdump_xval, 0, sizeof(sr_kemi_xval_t));
+
+ if (sipdump_event_info==NULL) {
+ sr_kemi_xval_null(&_ksr_kemi_sipdump_xval, SR_KEMI_XVAL_NULL_EMPTY);
+ return &_ksr_kemi_sipdump_xval;
+ }
+ _ksr_kemi_sipdump_xval.vtype = SR_KEMIP_STR;
+ _ksr_kemi_sipdump_xval.v.s = sipdump_event_info->buf;
+ return &_ksr_kemi_sipdump_xval;
+}
+
+/**
+ *
+ */
+static sr_kemi_xval_t* ki_sipdump_get_tag(sip_msg_t *msg)
+{
+ memset(&_ksr_kemi_sipdump_xval, 0, sizeof(sr_kemi_xval_t));
+
+ if (sipdump_event_info==NULL) {
+ sr_kemi_xval_null(&_ksr_kemi_sipdump_xval, SR_KEMI_XVAL_NULL_EMPTY);
+ return &_ksr_kemi_sipdump_xval;
+ }
+ _ksr_kemi_sipdump_xval.vtype = SR_KEMIP_STR;
+ _ksr_kemi_sipdump_xval.v.s = sipdump_event_info->tag;
+ return &_ksr_kemi_sipdump_xval;
+}
+
/**
*
*/
@@ -477,6 +514,16 @@ static sr_kemi_t sr_kemi_sipdump_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("sipdump"), str_init("get_buf"),
+ SR_KEMIP_XVAL, ki_sipdump_get_buf,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sipdump"), str_init("get_tag"),
+ SR_KEMIP_XVAL, ki_sipdump_get_tag,
+ { 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 } }
};