[asterisk-commits] qwell: branch 1.2 r43800 - in /branches/1.2: apps/app_playback.c pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Sep 27 12:35:10 MST 2006


Author: qwell
Date: Wed Sep 27 14:35:09 2006
New Revision: 43800

URL: http://svn.digium.com/view/asterisk?rev=43800&view=rev
Log:
Playback() wasn't setting PLAYBACKSTATUS under several circumstances.
Playback() returns -1 on missing args - so should Background()

Modified:
    branches/1.2/apps/app_playback.c
    branches/1.2/pbx.c

Modified: branches/1.2/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_playback.c?rev=43800&r1=43799&r2=43800&view=diff
==============================================================================
--- branches/1.2/apps/app_playback.c (original)
+++ branches/1.2/apps/app_playback.c Wed Sep 27 14:35:09 2006
@@ -110,6 +110,7 @@
 	if (chan->_state != AST_STATE_UP) {
 		if (option_skip) {
 			/* At the user's option, skip if the line is not up */
+			pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
 			LOCAL_USER_REMOVE(u);
 			return 0;
 		} else if (!option_noanswer)
@@ -137,11 +138,11 @@
 			}
 			front = back;
 		}
-		if (mres)
-			pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "FAILED");
-		else
-			pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
 	}
+	if (mres)
+		pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "FAILED");
+	else
+		pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", "SUCCESS");
 	LOCAL_USER_REMOVE(u);
 	return res;
 }

Modified: branches/1.2/pbx.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/pbx.c?rev=43800&r1=43799&r2=43800&view=diff
==============================================================================
--- branches/1.2/pbx.c (original)
+++ branches/1.2/pbx.c Wed Sep 27 14:35:09 2006
@@ -5745,7 +5745,7 @@
 			break;
 		default:
 			ast_log(LOG_WARNING, "Background requires an argument (filename)\n");
-			break;
+			return -1;
 		}
 	}
 



More information about the asterisk-commits mailing list