Module: kamailio
Branch: 5.5
Commit: a9deaa503ff20a3384fe74e37093464c21885e44
URL:
https://github.com/kamailio/kamailio/commit/a9deaa503ff20a3384fe74e37093464…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-02-16T11:10:10Z
rtpengine: avoid repeated queries to same node
If we know which node handles a particular call from the hash table,
only query that node once and then return error if it's dead, instead of
going into a pointless loop looking for other nodes to query which don't
exist.
closes #3370
(cherry picked from commit bd0ce126109f40f5217053f20e687b93b2268164)
(cherry picked from commit ea782be2cc29589f4dd55f0d91c11049b5280fe0)
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a9deaa503ff20a3384fe74e37093464…
Patch:
https://github.com/kamailio/kamailio/commit/a9deaa503ff20a3384fe74e37093464…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 62665205787..9cd3bd4061c 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3320,6 +3320,12 @@ select_rtpp_node(str callid, str viabranch, int do_test, struct
rtpp_node **quer
// lookup node
node = select_rtpp_node_old(callid, viabranch, do_test, op);
+ if (node && is_queried_node(node, queried_nodes_ptr, queried_nodes)) {
+ LM_ERR("rtpengine node for callid=%.*s is known (%.*s) but it has already been
queried, therefore not returning it\n",
+ callid.len, callid.s, node->rn_url.len, node->rn_url.s);
+ return NULL;
+ }
+
// check node
if (!node || (node_in_set(node, active_rtpp_set) == 0)) {
// run the selection algorithm