[asterisk-commits] qwell: trunk r43804 - in /trunk: ./ apps/app_playback.c main/pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Sep 27 12:45:25 MST 2006


Author: qwell
Date: Wed Sep 27 14:45:24 2006
New Revision: 43804

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

........
r43803 | qwell | 2006-09-27 12:44:02 -0700 (Wed, 27 Sep 2006) | 4 lines

Fix an issue with PLAYBACKSTATUS not being set under certain circumstances.
Fix a minor issue, to make it use the filenames that were parsed, instead of the entire argument string.
Fix Background() to return -1 like Playback(), if no args are specified.

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_playback.c
    trunk/main/pbx.c

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

Modified: trunk/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_playback.c?rev=43804&r1=43803&r2=43804&view=diff
==============================================================================
--- trunk/apps/app_playback.c (original)
+++ trunk/apps/app_playback.c Wed Sep 27 14:45:24 2006
@@ -380,6 +380,7 @@
 static int playback_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
+	int mres = 0;
 	struct ast_module_user *u;
 	char *tmp;
 	int option_skip=0;
@@ -422,11 +423,11 @@
 			res = ast_answer(chan);
 	}
 	if (!res) {
-		int mres = 0;
+		char *back = args.filenames;
 		char *front;
 
 		ast_stopstream(chan);
-		while (!res && (front = strsep(&tmp, "&"))) {
+		while (!res && (front = strsep(&back, "&"))) {
 			if (option_say)
 				res = say_full(chan, front, "", chan->language, NULL, -1, -1);
 			else
@@ -442,9 +443,9 @@
 				mres = 1;
 			}
 		}
-		pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
 	}
 done:
+	pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
 	ast_module_user_remove(u);
 	return res;
 }

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?rev=43804&r1=43803&r2=43804&view=diff
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Sep 27 14:45:24 2006
@@ -5292,8 +5292,10 @@
 		AST_APP_ARG(context);
 	);
 
-	if (ast_strlen_zero(data))
+	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Background requires an argument (filename)\n");
+		return -1;
+	}
 
 	parse = ast_strdupa(data);
 



More information about the asterisk-commits mailing list