summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-01-05 22:38:07 +0000
committerMark Spencer <markster@digium.com>2005-01-05 22:38:07 +0000
commit87b40b4d1408dad28efb992e2a4582ab94cb4a76 (patch)
tree016198ea6144c76d1b79a28e9509aa29d8f0ba3f /res
parentc31621bbecc69191d4065d1250f4e5aff7104610 (diff)
Stream courtesy tone if appropriate
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rwxr-xr-xres/res_features.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/res/res_features.c b/res/res_features.c
index 84e22cf0c..04147cd20 100755
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -370,8 +370,10 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee
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 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee
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;
}