Module: kamailio Branch: master Commit: f2458a66ae46a74b83fe2a3f3886f6015249a960 URL: https://github.com/kamailio/kamailio/commit/f2458a66ae46a74b83fe2a3f3886f601...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-05-19T14:23:01+02:00
core: kemi - functions to test http methods
---
Modified: src/core/kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/f2458a66ae46a74b83fe2a3f3886f601... Patch: https://github.com/kamailio/kamailio/commit/f2458a66ae46a74b83fe2a3f3886f601...
---
diff --git a/src/core/kemi.c b/src/core/kemi.c index c15621690a..2a63279795 100644 --- a/src/core/kemi.c +++ b/src/core/kemi.c @@ -1076,6 +1076,38 @@ static int sr_kemi_core_is_method_kdmq(sip_msg_t *msg) }
+/** + * + */ +static int sr_kemi_core_is_method_get(sip_msg_t *msg) +{ + return sr_kemi_core_is_method_type(msg, METHOD_GET); +} + +/** + * + */ +static int sr_kemi_core_is_method_post(sip_msg_t *msg) +{ + return sr_kemi_core_is_method_type(msg, METHOD_POST); +} + +/** + * + */ +static int sr_kemi_core_is_method_put(sip_msg_t *msg) +{ + return sr_kemi_core_is_method_type(msg, METHOD_PUT); +} + +/** + * + */ +static int sr_kemi_core_is_method_delete(sip_msg_t *msg) +{ + return sr_kemi_core_is_method_type(msg, METHOD_DELETE); +} + /** * */ @@ -1769,6 +1801,26 @@ static sr_kemi_t _sr_kemi_core[] = { { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init(""), str_init("is_GET"), + SR_KEMIP_BOOL, sr_kemi_core_is_method_get, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init(""), str_init("is_POST"), + SR_KEMIP_BOOL, sr_kemi_core_is_method_post, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init(""), str_init("is_PUT"), + SR_KEMIP_BOOL, sr_kemi_core_is_method_put, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init(""), str_init("is_DELETE"), + SR_KEMIP_BOOL, sr_kemi_core_is_method_delete, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, { str_init(""), str_init("is_UDP"), SR_KEMIP_BOOL, sr_kemi_core_is_proto_udp, { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,