diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-05 16:52:46 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-02-05 16:52:46 +0000 |
commit | afedd1cb91ec56e4c7d0f681a827ab37b2ba5d17 (patch) | |
tree | e6b1cea551ab56ba1bdab41d191ebfe3ff4fa16b /apps/app_record.c | |
parent | 1b7bf356675f2f299281d35933df05812125a9cb (diff) |
Add option to disable beep to record (bug #3508, with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4969 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_record.c')
-rwxr-xr-x | apps/app_record.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/app_record.c b/apps/app_record.c index 1a3a620aa..a06108162 100755 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -42,6 +42,7 @@ static char *descrip = " 'n' : do not answer, but record anyway if line not yet answered\n" " 'a' : append to existing recording rather than replacing\n" " 't' : use alternate '*' terminator key instead of default '#'\n" +" 'q' : quiet (do not play a beep tone)\n" "\n" "If filename contains '%d', these characters will be replaced with a number\n" "incremented by one each time the file is recorded. \n\n" @@ -79,6 +80,7 @@ static int record_exec(struct ast_channel *chan, void *data) int option_noanswer = 0; int option_append = 0; int terminator = '#'; + int option_quiet = 0; int rfmt = 0; int flags; @@ -143,6 +145,8 @@ static int record_exec(struct ast_channel *chan, void *data) option_append = 1; if (strchr(options, 't')) terminator = '*'; + if (strchr(options, 'q')) + option_quiet = 1; } } @@ -174,14 +178,17 @@ static int record_exec(struct ast_channel *chan, void *data) } if (!res) { - /* Some code to play a nice little beep to signify the start of the record operation */ - res = ast_streamfile(chan, "beep", chan->language); - if (!res) { - res = ast_waitstream(chan, ""); - } else { - ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", chan->name); + + if (!option_quiet) { + /* Some code to play a nice little beep to signify the start of the record operation */ + res = ast_streamfile(chan, "beep", chan->language); + if (!res) { + res = ast_waitstream(chan, ""); + } else { + ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", chan->name); + } + ast_stopstream(chan); } - ast_stopstream(chan); /* The end of beep code. Now the recording starts */ |