Module: kamailio Branch: master Commit: 330d01280b86e4325fe4a168f9564412cde0efa4 URL: https://github.com/kamailio/kamailio/commit/330d01280b86e4325fe4a168f9564412cde0efa4
Author: Daniel-Constantin Mierla <mico...@gmail.com> Committer: Daniel-Constantin Mierla <mico...@gmail.com> Date: 2025-07-21T12:42:32+02:00 tm: added optional flags parameter for t_relay_to_proxy() --- Modified: src/modules/tm/tm.c --- Diff: https://github.com/kamailio/kamailio/commit/330d01280b86e4325fe4a168f9564412cde0efa4.diff Patch: https://github.com/kamailio/kamailio/commit/330d01280b86e4325fe4a168f9564412cde0efa4.patch --- diff --git a/src/modules/tm/tm.c b/src/modules/tm/tm.c index e62c85d74af..9250d812061 100644 --- a/src/modules/tm/tm.c +++ b/src/modules/tm/tm.c @@ -137,7 +137,8 @@ static int w_t_relay_to_sctp_uri(struct sip_msg *, char *, char *); #endif static int w_t_relay_to_avp(struct sip_msg *msg, char *str, char *); static int w_t_relay_to(struct sip_msg *msg, char *str, char *); -static int w_t_relay_to_proxy(struct sip_msg *msg, char *str, char *); +static int w_t_relay_to_proxy(sip_msg_t *msg, char *paddr, char *p2); +static int w_t_relay_to_proxy_flags(sip_msg_t *msg, char *paddr, char *pflags); static int w_t_replicate_uri(struct sip_msg *p_msg, char *uri, /* sip uri as string or variable */ char *_foo /* nothing expected */); @@ -328,6 +329,8 @@ static cmd_export_t cmds[] = { REQUEST_ROUTE | FAILURE_ROUTE}, {"t_relay_to_proxy", w_t_relay_to_proxy, 1, fixup_spve_null, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE}, + {"t_relay_to_proxy", w_t_relay_to_proxy_flags, 1, fixup_spve_igp, + fixup_free_spve_igp, REQUEST_ROUTE | FAILURE_ROUTE}, {"t_forward_nonack", w_t_forward_nonack, 2, fixup_hostport2proxy, 0, REQUEST_ROUTE}, {"t_forward_nonack_uri", w_t_forward_nonack_uri, 0, 0, 0, @@ -3283,6 +3286,26 @@ static int w_t_relay_to_proxy(sip_msg_t *msg, char *paddr, char *bar) return ki_t_relay_to_proxy_flags(msg, &addr, 0); } +/** + * + */ +static int w_t_relay_to_proxy_flags(sip_msg_t *msg, char *paddr, char *pflags) +{ + str addr = STR_NULL; + int flags = 0; + + if(fixup_get_svalue(msg, (gparam_t *)paddr, &addr) != 0) { + LM_ERR("invalid proxy address parameter\n"); + return -1; + } + if(fixup_get_ivalue(msg, (gparam_t *)pflags, &flags) != 0) { + LM_ERR("invalid flags parameter\n"); + return -1; + } + + return ki_t_relay_to_proxy_flags(msg, &addr, flags); +} + /** * */ _______________________________________________ Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org To unsubscribe send an email to sr-dev-le...@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!