Module: kamailio Branch: master Commit: 96ada96f69f606c35fd46a45def3b095026f2393 URL: https://github.com/kamailio/kamailio/commit/96ada96f69f606c35fd46a45def3b095...
Author: Oded Arbel oded@geek.co.il Committer: GitHub noreply@github.com Date: 2024-06-30T12:40:53-04:00
rtpengine: add "active" field to rtpengine.show as alternate of "disabled" (#3898)
As per issue #3896, "active" is a boolean field that just describes whether the socket will be used, while "disabled" now just describes whether the socket was disabled by an RPC command. Also make "disabled" and "recheck_ticks" fields have a fixed value type of boolean and number respectively.
use `"recheck_ticks": -1` instead of "N/A" as per discussion
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/96ada96f69f606c35fd46a45def3b095... Patch: https://github.com/kamailio/kamailio/commit/96ada96f69f606c35fd46a45def3b095...
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 775542c5994..54f22b1843f 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -1784,13 +1784,14 @@ static int add_rtpp_node_info(
if((1 == crt_rtpp->rn_disabled) && (crt_rtpp->rn_recheck_ticks == RTPENGINE_MAX_RECHECK_TICKS)) { - rpc->struct_add(vh, "s", "disabled", "1(permanent)"); + rpc->struct_add(vh, "b", "disabled", 1); } else { - rpc->struct_add(vh, "d", "disabled", crt_rtpp->rn_disabled); + rpc->struct_add(vh, "b", "disabled", 0); } + rpc->struct_add(vh, "b", "active", crt_rtpp->rn_disabled == 0);
if(crt_rtpp->rn_recheck_ticks == RTPENGINE_MAX_RECHECK_TICKS) { - rpc->struct_add(vh, "s", "recheck_ticks", "N/A"); + rpc->struct_add(vh, "d", "recheck_ticks", -1); } else { rtpp_ticks = crt_rtpp->rn_recheck_ticks - get_ticks(); rtpp_ticks = rtpp_ticks < 0 ? 0 : rtpp_ticks;