### Description
When using the RPC command `rtpengine.show`, the resulting list has the field `disabled` for each RTPEngine configured, and its value - for some reason can be either `0` (number), `1` (number) or `"1(permanent)"` (string).
For example:
```
$ curl -k -X POST -HContent-Type:application/json -d '{"jsonrpc":"2.0","method":"rtpengine.show","params":["all"],"id":1}' https://localhost:8443/rpc
{
"jsonrpc": "2.0",
"result": [{
"url": "udp:old-rtpengine2227",
"set": 0,
"index": 0,
"weight": 1,
"disabled": 1,
"recheck_ticks": 0
}, {
"url": "udp:172.24.73.28:2227",
"set": 0,
"index": 1,
"weight": 1,
"disabled": 0,
"recheck_ticks": 0
}, {
"url": "udp:172.24.75.15:2227",
"set": 0,
"index": 2,
"weight": 1,
"disabled": "1(permanent)",
"recheck_ticks": "N/A"
}],
"id": 1
}
```
This makes it very annoying to parse the results from JSON RPC (and maybe other machine readable RPC APIs). Also the same problem for `recheck_ticks`, but I never actually read it so it is less important for me.
#### Reproduction
The difference between `0` and `"1(permanent)"` can be seen by setting up multiple RTPEngine sockets that work and then disable one of the using the `rtpengine.enable` RPC command with the `flag` set to `0`. As far as I can tell that is the only way to get `recheck_ticks` to be set to `RTPENGINE_MAX_RECHECK_TICKS` which causes the "permanently disabled" state.
### Possible Solutions
I can try to offer a patch, but any change I can make will be a breaking API change - so if users are relying on this weird behavior, that could be a problem.
Maybe the best way to move forward is to expose two additional fields:
- `active` : `boolean` - set to `true` if the RTPEngine is not disabled, and to `false` if it is disabled (i.e. the value is equal to `disabled == 0`).
- `active` : `boolean` - set to `true` if the RTPEngine had not failed it checks (i.e. `recheck_ticks` is either 0 or `RTPENGINE_MAX_RECHECK_TICKS`). This will be set to `false` if `disabled` is set to `1`, and not `"1(permanent)"`.
Maybe the last field is unneeded? Maybe `"disabled"` can be changed to only report whether the RPC was used to disable the socket and let the `active` field specify whether the socket can be used?
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.7.5 (x86_64/linux) 58499a
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 58499a
compiled on 00:00:00 Sep 13 2022 with gcc 11.4.1
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
$ uname -a
Linux sip-172-24-50-23.XX.XX.XX 6.5.0-1020-aws #20~22.04.1-Ubuntu SMP Wed May 1 16:10:50 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release
NAME="AlmaLinux"
VERSION="9.4 (Seafoam Ocelot)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.4 (Seafoam Ocelot)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"
ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
SUPPORT_END=2032-06-01
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3896
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3896(a)github.com>
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [x] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #3896
#### Description
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.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3898
-- Commit Summary --
* rtpengine: add "active" field to rtpengine.show as alternate of "disabled"
-- File Changes --
M src/modules/rtpengine/rtpengine.c (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3898.patchhttps://github.com/kamailio/kamailio/pull/3898.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3898
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3898(a)github.com>
Module: kamailio
Branch: master
Commit: 96ada96f69f606c35fd46a45def3b095026f2393
URL: https://github.com/kamailio/kamailio/commit/96ada96f69f606c35fd46a45def3b09…
Author: Oded Arbel <oded(a)geek.co.il>
Committer: GitHub <noreply(a)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/96ada96f69f606c35fd46a45def3b09…
Patch: https://github.com/kamailio/kamailio/commit/96ada96f69f606c35fd46a45def3b09…
---
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;
Hey everybody,
While attempting to use the official Ubuntu package for Kamailio version 5.7.4 on Ubunut 24.04, we encountered an issue where TLS functionality does not seem to work as expected but 5.8 branch does.
Given this, I am inquiring about the availability and status of Kamailio packages for Ubuntu 24.04 on the official Kamailio repository at deb.kamailio.org. Are there any plans to support this version of Ubuntu with updated packages? If so, is there an estimated timeline for when these packages might become available?
Thank you in advance for your assistance.
Best regards,
Xenofon