mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Add option to disable beep to record (bug #3508, with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -42,6 +42,7 @@ static char *descrip =
|
|||||||
" 'n' : do not answer, but record anyway if line not yet answered\n"
|
" 'n' : do not answer, but record anyway if line not yet answered\n"
|
||||||
" 'a' : append to existing recording rather than replacing\n"
|
" 'a' : append to existing recording rather than replacing\n"
|
||||||
" 't' : use alternate '*' terminator key instead of default '#'\n"
|
" 't' : use alternate '*' terminator key instead of default '#'\n"
|
||||||
|
" 'q' : quiet (do not play a beep tone)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"If filename contains '%d', these characters will be replaced with a number\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"
|
"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_noanswer = 0;
|
||||||
int option_append = 0;
|
int option_append = 0;
|
||||||
int terminator = '#';
|
int terminator = '#';
|
||||||
|
int option_quiet = 0;
|
||||||
int rfmt = 0;
|
int rfmt = 0;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
@@ -143,6 +145,8 @@ static int record_exec(struct ast_channel *chan, void *data)
|
|||||||
option_append = 1;
|
option_append = 1;
|
||||||
if (strchr(options, 't'))
|
if (strchr(options, 't'))
|
||||||
terminator = '*';
|
terminator = '*';
|
||||||
|
if (strchr(options, 'q'))
|
||||||
|
option_quiet = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,14 +178,17 @@ static int record_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!res) {
|
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 (!option_quiet) {
|
||||||
if (!res) {
|
/* Some code to play a nice little beep to signify the start of the record operation */
|
||||||
res = ast_waitstream(chan, "");
|
res = ast_streamfile(chan, "beep", chan->language);
|
||||||
} else {
|
if (!res) {
|
||||||
ast_log(LOG_WARNING, "ast_streamfile failed on %s\n", chan->name);
|
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 */
|
/* The end of beep code. Now the recording starts */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user