mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 19:16:46 +00:00
Provide a little more protection to make sure that a MOH class is specified when using the 'm' option with WaitExten, and prevent a segfault in the process.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5232,8 +5232,10 @@ static int pbx_builtin_waitexten(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
if (args.options)
|
if (args.options)
|
||||||
ast_app_parse_options(waitexten_opts, &flags, opts, args.options);
|
ast_app_parse_options(waitexten_opts, &flags, opts, args.options);
|
||||||
|
|
||||||
if (ast_test_flag(&flags, WAITEXTEN_MOH))
|
if (ast_test_flag(&flags, WAITEXTEN_MOH) && !opts[0] ) {
|
||||||
|
ast_log(LOG_WARNING, "The 'm' option has been specified for WaitExten without a class.\n");
|
||||||
|
} else if (ast_test_flag(&flags, WAITEXTEN_MOH))
|
||||||
ast_indicate_data(chan, AST_CONTROL_HOLD, opts[0], strlen(opts[0]));
|
ast_indicate_data(chan, AST_CONTROL_HOLD, opts[0], strlen(opts[0]));
|
||||||
|
|
||||||
/* Wait for "n" seconds */
|
/* Wait for "n" seconds */
|
||||||
|
Reference in New Issue
Block a user