[asterisk-commits] oej: trunk r217482 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 9 15:09:35 CDT 2009


Author: oej
Date: Wed Sep  9 15:09:31 2009
New Revision: 217482

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217482
Log:
Don't report transfer success until we actually know. 1xx messages are not final.

Related to #12713

Patch by oej

A big thank you to file for finally fixing the transfer() dialplan application.
I've been waiting for years for this. Great work!

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=217482&r1=217481&r2=217482
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Sep  9 15:09:31 2009
@@ -19506,12 +19506,15 @@
 		case 100:	/* Trying: */
 		case 101:	/* dialog establishment */
 			/* Don't do anything yet */
+			success = -1;	/* Wait */
 			break;
 		case 183:	/* Ringing: */
 			/* Don't do anything yet */
+			success = -1;	/* Wait */
 			break;
 		case 200:	/* OK: The new call is up, hangup this call */
 			/* Hangup the call that we are replacing */
+			success = -1;	/* Wait */
 			break;
 		case 301: /* Moved permenantly */
 		case 302: /* Moved temporarily */
@@ -19527,11 +19530,11 @@
 			success = FALSE;
 			break;
 		}
-		if (!success) {
+		if (success == FALSE) {
 			ast_log(LOG_NOTICE, "Transfer failed. Sorry. Nothing further to do with this call\n");
 		}
 
-		if (p->owner) {
+		if (p->owner && success != -1) {
 			enum ast_control_transfer message = success ? AST_TRANSFER_SUCCESS : AST_TRANSFER_FAILED;
 			ast_queue_control_data(p->owner, AST_CONTROL_TRANSFER, &message, sizeof(message));
 		}




More information about the asterisk-commits mailing list