[asterisk-commits] mmichelson: branch 1.6.1 r148115 - in /branches/1.6.1: ./ main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 9 18:20:08 CDT 2008


Author: mmichelson
Date: Thu Oct  9 18:20:08 2008
New Revision: 148115

URL: http://svn.digium.com/view/asterisk?view=rev&rev=148115
Log:
Merged revisions 148112 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r148112 | mmichelson | 2008-10-09 18:15:33 -0500 (Thu, 09 Oct 2008) | 26 lines

Merged revisions 146026 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r146026 | murf | 2008-10-03 12:12:54 -0500 (Fri, 03 Oct 2008) | 18 lines

(closes issue #13579)
Reported by: dwagner

(closes issue #13584)
Reported by: dwagner
Tested by: murf, putnopvut

The thought occurred to me that the res= from the extension spawn
was ending up being returned from the bridge.

"Thou shalt not poison the return value". Made the change
and it appears to allow blind xfers to work as normal.

If I'm wrong, reopen the bugs. But it looks good to me!

Many thanks to putnopvut for helping me reproduce this!


........

................

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/main/features.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/main/features.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/main/features.c?view=diff&rev=148115&r1=148114&r2=148115
==============================================================================
--- branches/1.6.1/main/features.c (original)
+++ branches/1.6.1/main/features.c Thu Oct  9 18:20:08 2008
@@ -2387,6 +2387,7 @@
 		char save_exten[AST_MAX_EXTENSION];
 		int  save_prio;
 		int  found = 0;	/* set if we find at least one match */
+		int  spawn_error = 0;
 		
 		if (ast_opt_end_cdr_before_h_exten) {
 			ast_cdr_end(bridge_cdr);
@@ -2403,15 +2404,13 @@
 		ast_copy_string(chan->exten, "h", sizeof(chan->exten));
 		chan->priority = 1;
 		ast_channel_unlock(chan);
-		while ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num, &found, 1)) == 0) {
+		while ((spawn_error = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num, &found, 1)) == 0) {
 			chan->priority++;
 		}
-		if (found && res) {
+		if (found && spawn_error) {
 			/* Something bad happened, or a hangup has been requested. */
 			ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", chan->context, chan->exten, chan->priority, chan->name);
 			ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", chan->context, chan->exten, chan->priority, chan->name);
-		} else if (!found && res) {
-			res = 0;
 		}
 		/* swap it back */
 		ast_channel_lock(chan);




More information about the asterisk-commits mailing list