[asterisk-commits] twilson: branch twilson/config_work r367120 - /team/twilson/config_work/apps/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun May 20 16:07:52 CDT 2012
Author: twilson
Date: Sun May 20 16:07:41 2012
New Revision: 367120
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=367120
Log:
Play prompt when no/invalid value entered
Modified:
team/twilson/config_work/apps/app_skel.c
Modified: team/twilson/config_work/apps/app_skel.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/apps/app_skel.c?view=diff&rev=367120&r1=367119&r2=367120
==============================================================================
--- team/twilson/config_work/apps/app_skel.c (original)
+++ team/twilson/config_work/apps/app_skel.c Sun May 20 16:07:41 2012
@@ -300,11 +300,11 @@
{
int win = 0;
uint32_t guesses;
- struct ast_flags flags;
- char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
RAII_VAR(struct skel_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
RAII_VAR(struct skel_level *, level, NULL, ao2_cleanup);
RAII_VAR(struct skel_current_game *, game, NULL, ao2_cleanup);
+ char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
+ struct ast_flags flags;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(level);
AST_APP_ARG(options);
@@ -372,6 +372,9 @@
/* Read the number pressed */
ast_readstring(chan, buf, buflen - 1, 2000, 10000, "");
if (ast_parse_arg(buf, PARSE_INT32 | PARSE_IN_RANGE, &guess, 0, level->max_num)) {
+ if (guesses < level->max_guesses - 1) {
+ play_files_helper(chan, cfg->global->wrong);
+ }
continue;
}
More information about the asterisk-commits
mailing list