[sr-dev] git:4.3:340c40ac: tm: check all the outgoing branches when appending a new branch

Federico Cabiddu federico.cabiddu at gmail.com
Fri Sep 4 15:14:22 CEST 2015


Module: kamailio
Branch: 4.3
Commit: 340c40ac4b282c57f20009e987aec26c5877d62e
URL: https://github.com/kamailio/kamailio/commit/340c40ac4b282c57f20009e987aec26c5877d62e

Author: Federico Cabiddu <federico.cabiddu at gmail.com>
Committer: Federico Cabiddu <federico.cabiddu at gmail.com>
Date: 2015-09-04T15:14:12+02:00

tm: check all the outgoing branches when appending a new branch

(cherry picked from commit 27bed654dcc4e9dd543a7f2f92e2174478bf7f26)

---

Modified: modules/tm/t_append_branches.c

---

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

---

diff --git a/modules/tm/t_append_branches.c b/modules/tm/t_append_branches.c
index 8060021..f16c672 100644
--- a/modules/tm/t_append_branches.c
+++ b/modules/tm/t_append_branches.c
@@ -23,6 +23,9 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
+ * History:
+ * -------
+ *  2014-09-09  first release of t_append_branches
  *
  */
 
@@ -106,8 +109,6 @@ int t_append_branches(void) {
 		set_branch_route(t->on_branch_delayed);
 	}
 
-	outgoings = t->nr_of_outgoings;
-
 	/* not really sure that the following is needed */
 
 	set_branch_iterator(nr_branches-1);
@@ -116,7 +117,7 @@ int t_append_branches(void) {
 										&bflags, &si, &ruid, &instance, &location_ua))) {
 		LM_DBG("Current uri %.*s\n",current_uri.len, current_uri.s);
 
-		for (i=0; i<=nr_branches; i++) {
+		for (i=0; i<outgoings; i++) {
 			if (t->uac[i].ruid.len == ruid.len
 					&& !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len)) {
 				LM_DBG("branch already added [%.*s]\n", ruid.len, ruid.s);
@@ -133,6 +134,8 @@ int t_append_branches(void) {
 					&path, 0, si, orig_msg->fwd_send_flags,
 					orig_msg->rcv.proto, (dst_uri.len)?-1:UAC_SKIP_BR_DST_F, &instance,
 					&ruid, &location_ua);
+		
+		LM_DBG("added branch [%.*s] with ruid [%.*s]\n", current_uri.len, current_uri.s, ruid.len, ruid.s);
 
 		/* test if cancel was received meanwhile */
 		if (t->flags & T_CANCELED) goto canceled;




More information about the sr-dev mailing list