Browse code

- 487 no longer generated localy (hopefuly, UACs are well-behaving and no longer go crazy if it takes time to get the 487 due to another branch which is unresponsive) -> race conditions (200 coming from upstream) eliminated; - messages complaining about UAC status rewrites removed in special cases: a) negative reply retransmission b) receipt of 487 on a branch which was localy 408-ed

Jiri Kuthan authored on 23/02/2004 04:34:34
Showing 2 changed files
... ...
@@ -362,6 +362,15 @@ void e2e_cancel( struct sip_msg *cancel_msg,
362 362
 		DBG("DEBUG: e2e_cancel: e2e cancel -- no more pending branches\n");
363 363
 		t_reply( t_cancel, cancel_msg, 200, CANCEL_DONE );
364 364
 	}
365
+
366
+#ifdef LOCAL_487
367
+
368
+	/* local 487s have been deprecated -- it better handles
369
+	 * race conditions (UAS sending 200); hopefuly there are
370
+	 * no longer UACs who go crazy waiting for the 487 whose
371
+	 * forwarding is being blocked by other unreponsive branch
372
+	 */
373
+
365 374
 	/* we could await downstream UAS's 487 replies; however,
366 375
 	   if some of the branches does not do that, we could wait
367 376
 	   long time and annoy upstream UAC which wants to see 
... ...
@@ -378,6 +387,7 @@ void e2e_cancel( struct sip_msg *cancel_msg,
378 387
 	   "can't reply twice"
379 388
 	*/
380 389
 	t_reply(t_invite, t_invite->uas.request, 487, CANCELLED );
390
+#endif
381 391
 }
382 392
 
383 393
 
... ...
@@ -624,6 +624,19 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
624 624
 	/* if final response received at this branch, allow only INVITE 2xx */
625 625
 	if (Trans->uac[branch].last_received>=200
626 626
 			&& !(inv_through && Trans->uac[branch].last_received<300)) {
627
+		/* don't report on retranmissions */
628
+		if (Trans->uac[branch].last_received==new_code) {
629
+			DBG("DEBUG: final reply retrasnmission\n");
630
+			goto discard;
631
+		}
632
+		/* if you FR-timed-out, faked a local 408 and 487 came, don't
633
+		 * report on it either */
634
+		if (Trans->uac[branch].last_received==408 && new_code==487) {
635
+			DBG("DEBUG: 487 came for a timed-out branch\n");
636
+			goto discard;
637
+		}
638
+		/* this looks however how a very strange status rewrite attempt;
639
+		 * report on it */
627 640
 		LOG(L_ERR, "ERROR: t_should_relay: status rewrite by UAS: "
628 641
 			"stored: %d, received: %d\n",
629 642
 			Trans->uac[branch].last_received, new_code );