Browse code

tm: 487 Request Terminated has priority when transaction is cancelled and no reply received from downstream

- for cancel_b_method 1, timeout was sent back even when transaction was
canceled

(cherry picked from commit 6c3725d5535e0b5bff5c63251d37e7139f92321c)

Daniel-Constantin Mierla authored on 01/03/2014 09:46:57
Showing 1 changed files
... ...
@@ -1845,8 +1845,13 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
1845 1845
 		 * or a stored message */
1846 1846
 		relayed_msg = branch==relay ? p_msg :  t->uac[relay].reply;
1847 1847
 		if (relayed_msg==FAKED_REPLY) {
1848
-			relayed_code = branch==relay
1849
-				? msg_status : t->uac[relay].last_received;
1848
+			if(t->flags & T_CANCELED) {
1849
+				/* transaction canceled - send 487 */
1850
+				relayed_code = 487;
1851
+			} else {
1852
+				relayed_code = branch==relay
1853
+					? msg_status : t->uac[relay].last_received;
1854
+			}
1850 1855
 			/* use to_tag from the original request, or if not present,
1851 1856
 			 * generate a new one */
1852 1857
 			if (relayed_code>=180 && t->uas.request->to