浏览代码

- send 480 when C timer hits and a provisional reply has been received
(as opposed to 408)

Jan Janak 20 年之前
父节点
当前提交
05b7a20de7
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      modules/tm/timer.c

+ 11 - 2
modules/tm/timer.c

@@ -331,7 +331,7 @@ inline static void retransmission_handler( struct timer_link *retr_tl )
 
 
 inline static void final_response_handler( struct timer_link *fr_tl )
 inline static void final_response_handler( struct timer_link *fr_tl )
 {
 {
-	int silent;
+	int silent, reply_code;
 	struct retr_buf* r_buf;
 	struct retr_buf* r_buf;
 	struct cell *t;
 	struct cell *t;
 
 
@@ -408,7 +408,16 @@ inline static void final_response_handler( struct timer_link *fr_tl )
 	}
 	}
 
 
 	DBG("DEBUG: final_response_handler:stop retr. and send CANCEL (%p)\n", t);
 	DBG("DEBUG: final_response_handler:stop retr. and send CANCEL (%p)\n", t);
-	fake_reply(t, r_buf->branch, 408 );
+
+	if (is_invite(t) && 
+	    r_buf->branch < MAX_BRANCHES && r_buf->branch >= 0 &&
+	    t->uac[r_buf->branch].last_received > 0) {
+		reply_code = 480; /* Request Terminated */
+	} else {
+		reply_code = 408; /* Request Timeout */
+	}
+
+	fake_reply(t, r_buf->branch, reply_code );
 
 
 	DBG("DEBUG: final_response_handler : done\n");
 	DBG("DEBUG: final_response_handler : done\n");
 }
 }