mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
app_page.c: Don't fail to Page if beep sound file is missing
ASTERISK-16799 #close Change-Id: I40367b0d6dbf66a39721bde060c8b2d734a61cf4
This commit is contained in:
committed by
George Joseph
parent
15afabdf8e
commit
6673c1b177
@@ -160,6 +160,8 @@ AST_APP_OPTIONS(page_opts, {
|
|||||||
AST_APP_OPTION('n', PAGE_NOCALLERANNOUNCE),
|
AST_APP_OPTION('n', PAGE_NOCALLERANNOUNCE),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#define PAGE_BEEP "beep"
|
||||||
|
|
||||||
/* We use this structure as a way to pass this to all dialed channels */
|
/* We use this structure as a way to pass this to all dialed channels */
|
||||||
struct page_options {
|
struct page_options {
|
||||||
char *opts[OPT_ARG_ARRAY_SIZE];
|
char *opts[OPT_ARG_ARRAY_SIZE];
|
||||||
@@ -402,9 +404,14 @@ static int page_exec(struct ast_channel *chan, const char *data)
|
|||||||
ast_free(predial_callee);
|
ast_free(predial_callee);
|
||||||
|
|
||||||
if (!ast_test_flag(&options.flags, PAGE_QUIET)) {
|
if (!ast_test_flag(&options.flags, PAGE_QUIET)) {
|
||||||
res = ast_streamfile(chan, "beep", ast_channel_language(chan));
|
if (!ast_fileexists(PAGE_BEEP, NULL, NULL)) {
|
||||||
if (!res)
|
ast_log(LOG_WARNING, "Missing required sound file: '" PAGE_BEEP "'\n");
|
||||||
res = ast_waitstream(chan, "");
|
} else {
|
||||||
|
res = ast_streamfile(chan, PAGE_BEEP, ast_channel_language(chan));
|
||||||
|
if (!res) {
|
||||||
|
res = ast_waitstream(chan, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
Reference in New Issue
Block a user