[svn-commits] oej: trunk r66504 - in /trunk: ./ channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue May 29 12:35:44 MST 2007


Author: oej
Date: Tue May 29 14:35:43 2007
New Revision: 66504

URL: http://svn.digium.com/view/asterisk?view=rev&rev=66504
Log:
Merged revisions 66503 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r66503 | oej | 2007-05-29 21:32:57 +0200 (Tue, 29 May 2007) | 2 lines

Properly handle 408 request timeout - according to the RFC, the dialog dies if a request in a dialog gets this response.

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=66504&r1=66503&r2=66504
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue May 29 14:35:43 2007
@@ -12809,6 +12809,7 @@
 		sip_alreadygone(p);
 		break;
 
+	case 408: /* Request timeout */
 	case 481: /* Call leg does not exist */
 		/* Could be REFER caused INVITE with replaces */
 		ast_log(LOG_WARNING, "Re-invite to non-existing call leg on other UA. SIP dialog '%s'. Giving up.\n", p->callid);
@@ -12973,6 +12974,14 @@
 			ast_log(LOG_NOTICE, "Failed to authenticate on REGISTER to '%s' (tries '%d')\n", get_header(&p->initreq, "From"), p->authtries);
 			ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		}
+		break;
+	case 408:	/* Request timeout */
+		if (global_regattempts_max)
+			p->registry->regattempts = global_regattempts_max+1;
+		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
+		r->call = NULL;
+		ast_sched_del(sched, r->timeout);
+		r->timeout = -1;
 		break;
 	case 423:	/* Interval too brief */
 		r->expiry = atoi(get_header(req, "Min-Expires"));
@@ -13271,6 +13280,21 @@
 			if (sipmethod == SIP_REGISTER)
 				res = handle_response_register(p, resp, rest, req, seqno);
 			break;
+		case 408: /* Request timeout - terminate dialog */
+			if (sipmethod == SIP_INVITE)
+				handle_response_invite(p, resp, rest, req, seqno);
+			else if (sipmethod == SIP_REGISTER) 
+				res = handle_response_register(p, resp, rest, req, ignore, seqno);
+			else if (sipmethod == SIP_BYE) {
+				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); 
+				if (option_debug)
+					ast_log(LOG_DEBUG, "Got timeout on bye. Thanks for the answer. Now, kill this call\n");
+			} else {
+				if (owner)
+					ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
+			}
+			break;
 		case 481: /* Call leg does not exist */
 			if (sipmethod == SIP_INVITE) {
 				handle_response_invite(p, resp, rest, req, seqno);



More information about the svn-commits mailing list