Browse code

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

Federico Cabiddu authored on 04/09/2015 13:12:29
Showing 1 changed files
... ...
@@ -23,6 +23,9 @@
23 23
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24 24
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 25
  *
26
+ * History:
27
+ * -------
28
+ *  2014-09-09  first release of t_append_branches
26 29
  *
27 30
  */
28 31
 
... ...
@@ -106,8 +109,6 @@ int t_append_branches(void) {
106 106
 		set_branch_route(t->on_branch_delayed);
107 107
 	}
108 108
 
109
-	outgoings = t->nr_of_outgoings;
110
-
111 109
 	/* not really sure that the following is needed */
112 110
 
113 111
 	set_branch_iterator(nr_branches-1);
... ...
@@ -116,7 +117,7 @@ int t_append_branches(void) {
116 116
 										&bflags, &si, &ruid, &instance, &location_ua))) {
117 117
 		LM_DBG("Current uri %.*s\n",current_uri.len, current_uri.s);
118 118
 
119
-		for (i=0; i<=nr_branches; i++) {
119
+		for (i=0; i<outgoings; i++) {
120 120
 			if (t->uac[i].ruid.len == ruid.len
121 121
 					&& !memcmp(t->uac[i].ruid.s, ruid.s, ruid.len)) {
122 122
 				LM_DBG("branch already added [%.*s]\n", ruid.len, ruid.s);
... ...
@@ -133,6 +134,8 @@ int t_append_branches(void) {
133 133
 					&path, 0, si, orig_msg->fwd_send_flags,
134 134
 					orig_msg->rcv.proto, (dst_uri.len)?-1:UAC_SKIP_BR_DST_F, &instance,
135 135
 					&ruid, &location_ua);
136
+		
137
+		LM_DBG("added branch [%.*s] with ruid [%.*s]\n", current_uri.len, current_uri.s, ruid.len, ruid.s);
136 138
 
137 139
 		/* test if cancel was received meanwhile */
138 140
 		if (t->flags & T_CANCELED) goto canceled;