Module: kamailio Branch: 6.1 Commit: 35c48f4fbb5fc70371cdfccbe80c23c888a7efa3 URL: https://github.com/kamailio/kamailio/commit/35c48f4fbb5fc70371cdfccbe80c23c888a7efa3
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2026-02-25T21:23:38+01:00 rtpengine: exported start_/stop_forwarding() to kemi - GH #4598 (cherry picked from commit fd75abf30ae80bd3243cd5942f071457fb4bc0aa) --- Modified: src/core/tcp_read.c Modified: src/modules/rtpengine/rtpengine.c --- Diff: https://github.com/kamailio/kamailio/commit/35c48f4fbb5fc70371cdfccbe80c23c888a7efa3.diff Patch: https://github.com/kamailio/kamailio/commit/35c48f4fbb5fc70371cdfccbe80c23c888a7efa3.patch --- diff --git a/src/core/tcp_read.c b/src/core/tcp_read.c index 9c51774c474..3cd5ba8be5d 100644 --- a/src/core/tcp_read.c +++ b/src/core/tcp_read.c @@ -351,7 +351,7 @@ int tcp_read_data(int fd, struct tcp_connection *c, char *buf, int b_size, } } else if(unlikely((bytes_read == 0) || (*flags & RD_CONN_FORCE_EOF))) { LM_DBG("EOF on connection %p (state: %u, flags: %x) - FD %d," - " bytes %d, rd-flags %x ([%s]:%u -> [%s]:%u)", + " bytes %d, rd-flags %x ([%s]:%u -> [%s]:%u)\n", c, c->state, c->flags, fd, bytes_read, *flags, ip_addr2xa(&c->rcv.src_ip), c->rcv.src_port, ip_addr2xa(&c->rcv.dst_ip), c->rcv.dst_port); diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 54979ad3214..8abef465026 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -6483,6 +6483,46 @@ static int ki_stop_media2(sip_msg_t *msg, str *flags, str *viabranch) msg, rtpengine_simple_wrap, parms, 1, OP_STOP_MEDIA); } +/* KI - start forwarding */ +static int ki_start_forwarding0(sip_msg_t *msg) +{ + void *parms[2] = {NULL, NULL}; + return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_START_FORWARDING); +} +static int ki_start_forwarding(sip_msg_t *msg, str *flags) +{ + void *parms[2] = {flags, NULL}; + return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_START_FORWARDING); +} +static int ki_start_forwarding2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; + return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_START_FORWARDING); +} + +/* KI - stop forwarding */ +static int ki_stop_forwarding0(sip_msg_t *msg) +{ + void *parms[2] = {NULL, NULL}; + return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_STOP_FORWARDING); +} +static int ki_stop_forwarding(sip_msg_t *msg, str *flags) +{ + void *parms[2] = {flags, NULL}; + return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_STOP_FORWARDING); +} +static int ki_stop_forwarding2(sip_msg_t *msg, str *flags, str *viabranch) +{ + void *parms[2] = {flags, viabranch}; + return rtpengine_rtpp_set_wrap( + msg, rtpengine_simple_wrap, parms, 1, OP_STOP_FORWARDING); +} + static int ki_set_rtpengine_set(sip_msg_t *msg, int r1) { rtpp_set_link_t rtpl1; @@ -6751,6 +6791,37 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("rtpengine"), str_init("start_forwarding0"), + SR_KEMIP_INT, ki_start_forwarding0, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("rtpengine"), str_init("start_forwarding"), + SR_KEMIP_INT, ki_start_forwarding, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("rtpengine"), str_init("start_forwarding2"), + SR_KEMIP_INT, ki_start_forwarding2, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("rtpengine"), str_init("stop_forwarding0"), + SR_KEMIP_INT, ki_stop_forwarding0, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("rtpengine"), str_init("stop_forwarding"), + SR_KEMIP_INT, ki_stop_forwarding, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("rtpengine"), str_init("stop_forwarding2"), + SR_KEMIP_INT, ki_stop_forwarding2, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("rtpengine"), str_init("set_rtpengine_set"), SR_KEMIP_INT, ki_set_rtpengine_set, { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE, _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
