diff --git a/apps/app_dial.c b/apps/app_dial.c index 81a834fb05..e233550272 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1988,10 +1988,12 @@ static int retrydial_exec(struct ast_channel *chan, void *data) parse = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, parse); - if ((sleep = atoi(args.sleep))) + if (!ast_strlen_zero(args.sleep) && (sleep = atoi(args.sleep))) sleep *= 1000; - loops = atoi(args.retries); + if (!ast_strlen_zero(args.retries)) { + loops = atoi(args.retries); + } if (!args.dialdata) { ast_log(LOG_ERROR, "%s requires a 4th argument (dialdata)\n", rapp);