Module: kamailio
Branch: master
Commit: 40b735216c610cae2da5b0758af31b1d3ade4731
URL:
https://github.com/kamailio/kamailio/commit/40b735216c610cae2da5b0758af31b1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-02-01T21:38:25+01:00
rtpengine: optional ping parameter for rpc reload command
- specify if ping should be done to rtpengines at reload time
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/40b735216c610cae2da5b0758af31b1…
Patch:
https://github.com/kamailio/kamailio/commit/40b735216c610cae2da5b0758af31b1…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index e3e4c6e1d50..74983124964 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -1609,6 +1609,8 @@ static int rtpp_test_ping(struct rtpp_node *node)
static void rtpengine_rpc_reload(rpc_t *rpc, void *ctx)
{
time_t tnow;
+ int rping = 1;
+ int n = 0;
if(rtpp_db_url.s == NULL) {
// no database
@@ -1621,6 +1623,13 @@ static void rtpengine_rpc_reload(rpc_t *rpc, void *ctx)
return;
}
+ n = rpc->scan(ctx, "*d", &rping);
+ if(n != 1) {
+ rping = 1;
+ } else if(rping != 0) {
+ rping = 1;
+ }
+
tnow = time(NULL);
if(tnow - _rtpe_list_version->vertime < RTPE_LIST_VERSION_DELAY) {
rpc->fault(ctx, 500, "Too short reload interval - try later");
@@ -1634,7 +1643,7 @@ static void rtpengine_rpc_reload(rpc_t *rpc, void *ctx)
return;
}
- if(build_rtpp_socks(1, 1)) {
+ if(build_rtpp_socks(1, rping)) {
rpc->fault(ctx, 500, "Failed to build rtpengine sockets");
return;
}