Module: kamailio Branch: master Commit: e4edf53858c399e5a3e635d04725a8a137523d15 URL: https://github.com/kamailio/kamailio/commit/e4edf53858c399e5a3e635d04725a8a1...
Author: juha-h jh@tutpro.com Committer: GitHub noreply@github.com Date: 2019-08-26T21:43:53+03:00
Merge pull request #2040 from kamailio/set_rtpengine_set
modules/rtpengine: set_rtpengine_set fix
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/e4edf53858c399e5a3e635d04725a8a1... Patch: https://github.com/kamailio/kamailio/commit/e4edf53858c399e5a3e635d04725a8a1...
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 7a6b73d747..6e436083ec 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -3079,6 +3079,15 @@ select_rtpp_node_old(str callid, str viabranch, int do_test, enum rtpe_operation return node; }
+unsigned int node_in_set(struct rtpp_node *node, struct rtpp_set *set) { + struct rtpp_node *current = set->rn_first; + while (current) { + if (current->idx == node->idx) return 1; + current = current->rn_next; + } + return 0; +} + /* * Main balancing routine. This DO try to keep the same proxy for * the call if some proxies were disabled or enabled (e.g. kamctl command) @@ -3107,7 +3116,7 @@ select_rtpp_node(str callid, str viabranch, int do_test, struct rtpp_node **quer node = select_rtpp_node_old(callid, viabranch, do_test, op);
// check node - if (!node) { + if (!node || (node_in_set(node, active_rtpp_set) == 0)) { // run the selection algorithm node = select_rtpp_node_new(callid, viabranch, do_test, queried_nodes_ptr, queried_nodes);