Module: kamailio Branch: master Commit: a23ede7247b52ddc53dc0186810923dc1ae8c51c URL: https://github.com/kamailio/kamailio/commit/a23ede7247b52ddc53dc0186810923dc...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2022-04-14T12:11:37+02:00
corex: added forward_reply() function
- forward received reply on demand
---
Modified: src/modules/corex/corex_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/a23ede7247b52ddc53dc0186810923dc... Patch: https://github.com/kamailio/kamailio/commit/a23ede7247b52ddc53dc0186810923dc...
---
diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c index 765bedf5f1..3c6b6a59f4 100644 --- a/src/modules/corex/corex_mod.c +++ b/src/modules/corex/corex_mod.c @@ -34,6 +34,7 @@ #include "../../core/str_list.h" #include "../../core/events.h" #include "../../core/onsend.h" +#include "../../core/forward.h" #include "../../core/dns_cache.h" #include "../../core/parser/parse_uri.h" #include "../../core/parser/parse_param.h" @@ -47,6 +48,7 @@ MODULE_VERSION
static int nio_intercept = 0; +static int w_forward_reply(sip_msg_t *msg, char *p1, char *p2); static int w_append_branch(sip_msg_t *msg, char *su, char *sq); static int w_send_udp(sip_msg_t *msg, char *su, char *sq); static int w_send_tcp(sip_msg_t *msg, char *su, char *sq); @@ -105,6 +107,8 @@ static tr_export_t mod_trans[] = { };
static cmd_export_t cmds[]={ + {"forward_reply", (cmd_function)w_forward_reply, 0, 0, + 0, CORE_ONREPLY_ROUTE }, {"append_branch", (cmd_function)w_append_branch, 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE }, {"append_branch", (cmd_function)w_append_branch, 1, fixup_spve_null, @@ -249,6 +253,7 @@ static int child_init(int rank)
return 0; } + /** * destroy module function */ @@ -256,6 +261,15 @@ static void mod_destroy(void) { }
+/** + * forward reply based on via + */ +static int w_forward_reply(sip_msg_t *msg, char *p1, char *p2) +{ + forward_reply(msg); + return 1; +} + /** * config wrapper for append branch */