[sr-dev] git:master:fe6614fe: modules/rtpengine: set_rtpengine_set fix

Juha Heinanen jh at tutpro.com
Mon Aug 26 20:43:58 CEST 2019


Module: kamailio
Branch: master
Commit: fe6614feb5f9b062a556de82fd7df6fc12c96471
URL: https://github.com/kamailio/kamailio/commit/fe6614feb5f9b062a556de82fd7df6fc12c96471

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date: 2019-08-23T10:05:33+03:00

modules/rtpengine: set_rtpengine_set fix

---

Modified: src/modules/rtpengine/rtpengine.c

---

Diff:  https://github.com/kamailio/kamailio/commit/fe6614feb5f9b062a556de82fd7df6fc12c96471.diff
Patch: https://github.com/kamailio/kamailio/commit/fe6614feb5f9b062a556de82fd7df6fc12c96471.patch

---

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);
 




More information about the sr-dev mailing list