[asterisk-commits] file: trunk r57011 - /trunk/apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 27 15:17:43 MST 2007


Author: file
Date: Tue Feb 27 16:17:42 2007
New Revision: 57011

URL: http://svn.digium.com/view/asterisk?view=rev&rev=57011
Log:
Properly hangup the original dialed channel, not the new channel that appeared from the forwarding. (issue #9161 reported by PhilSmith)

Modified:
    trunk/apps/app_dial.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=57011&r1=57010&r2=57011
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Tue Feb 27 16:17:42 2007
@@ -428,6 +428,7 @@
 	struct cause_args *num, struct ast_flags *peerflags, int single)
 {
 	char tmpchan[256];
+	struct ast_channel *original = o->chan;
 	struct ast_channel *c = o->chan; /* the winner */
 	struct ast_channel *in = num->chan; /* the input channel */
 	char *stuff;
@@ -498,7 +499,7 @@
 		if (ast_call(c, tmpchan, 0)) {
 			ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
 			ast_clear_flag(o, DIAL_STILLGOING);	
-			ast_hangup(c);
+			ast_hangup(original);
 			c = o->chan = NULL;
 			num->nochan++;
 		} else {
@@ -509,7 +510,7 @@
 				ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
 			}
 			/* Hangup the original channel now, in case we needed it */
-			ast_hangup(c);
+			ast_hangup(original);
 		}
 	}
 }



More information about the asterisk-commits mailing list