Module: kamailio
Branch: master
Commit: 0a2517f6e1b6a49eafd1846c1d65b4420ed404f5
URL:
https://github.com/kamailio/kamailio/commit/0a2517f6e1b6a49eafd1846c1d65b44…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-08-29T11:46:23+02:00
siputils: export sip_parse_headers() to kemi
---
Modified: src/modules/siputils/siputils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0a2517f6e1b6a49eafd1846c1d65b44…
Patch:
https://github.com/kamailio/kamailio/commit/0a2517f6e1b6a49eafd1846c1d65b44…
---
diff --git a/src/modules/siputils/siputils.c b/src/modules/siputils/siputils.c
index ffbeacd00a5..cdae4ff1f18 100644
--- a/src/modules/siputils/siputils.c
+++ b/src/modules/siputils/siputils.c
@@ -608,6 +608,17 @@ static int w_hdr_date_check(sip_msg_t *msg, char *ptdiff, char *p2)
return ki_hdr_date_check(msg, tdiff);
}
+/**
+ *
+ */
+static int ki_sip_parse_headers(sip_msg_t *msg)
+{
+ if(parse_headers(msg, HDR_EOH_F, 0) < 0) {
+ return -1;
+ }
+ return 1;
+}
+
/**
*
*/
@@ -784,6 +795,11 @@ static sr_kemi_t sr_kemi_siputils_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("siputils"), str_init("sip_parse_headers"),
+ SR_KEMIP_INT, ki_sip_parse_headers,
+ { 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 } }
};