[Asterisk-cvs] asterisk/res res_features.c,1.29,1.30

markster at lists.digium.com markster at lists.digium.com
Wed Jan 5 16:33:11 CST 2005


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv20729/res

Modified Files:
	res_features.c 
Log Message:
Stream courtesy tone if appropriate


Index: res_features.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_features.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- res_features.c	5 Jan 2005 22:13:37 -0000	1.29
+++ res_features.c	5 Jan 2005 22:38:07 -0000	1.30
@@ -370,8 +370,10 @@
         ast_verbose(VERBOSE_PREFIX_3 "User hit '%s' to record call.\n", code);
 	if (monitor_ok) {
 		if (!monitor_app) { 
-			if (!(monitor_app = pbx_findapp("Monitor")))
+			if (!(monitor_app = pbx_findapp("Monitor"))) {
 				monitor_ok=0;
+				return -1;
+			}
 		}
 		/* Copy to local variable just in case one of the channels goes away */
 		args = pbx_builtin_getvar_helper(chan, "TOUCH_MONITOR");
@@ -381,6 +383,19 @@
 			args = "WAV||m";
 
 		pbx_exec(peer, monitor_app, args, 1);
+		if (!ast_strlen_zero(courtesytone)) {
+			if (ast_autoservice_start(peer))
+				return -1;
+			if (!ast_streamfile(chan, courtesytone, chan->language)) {
+				if (ast_waitstream(chan, "") < 0) {
+					ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
+					ast_autoservice_stop(peer);
+					return -1;
+				}
+			}
+			if (ast_autoservice_stop(peer))
+				return -1;
+		}
 		return FEATURE_RETURN_SUCCESS;
 	}
 




More information about the svn-commits mailing list