Index: main/pbx.c =================================================================== --- main/pbx.c (revision 172437) +++ main/pbx.c (working copy) @@ -6356,7 +6356,7 @@ return __ast_goto_if_exists(chan, context, exten, priority, 1); } -int ast_parseable_goto(struct ast_channel *chan, const char *goto_string) +static int __ast_parseable_goto(struct ast_channel *chan, const char *goto_string, int exists) { char *exten, *pri, *context; char *stringp; @@ -6400,7 +6400,20 @@ if (mode) ipri = chan->priority + (ipri * mode); - ast_explicit_goto(chan, context, exten, ipri); - return 0; + if (exists) { + return __ast_goto_if_exists(chan, context, exten, ipri, 0); + } else { + return ast_explicit_goto(chan, context, exten, ipri); + } +} +int ast_parseable_goto(struct ast_channel *chan, const char *goto_string) +{ + return __ast_parseable_goto(chan, goto_string, 0); } + +int ast_parseable_goto_if_exists(struct ast_channel *chan, const char *goto_string) +{ + return __ast_parseable_goto(chan, goto_string, 1); +} + Index: include/asterisk/pbx.h =================================================================== --- include/asterisk/pbx.h (revision 172437) +++ include/asterisk/pbx.h (working copy) @@ -846,11 +846,12 @@ /*! * \note I can find neither parsable nor parseable at dictionary.com, * but google gives me 169000 hits for parseable and only 49,800 - * for parsable + * for parsable (update: parsable is now findable at dictionary.com) * * \note This function will handle locking the channel as needed. */ int ast_parseable_goto(struct ast_channel *chan, const char *goto_string); +int ast_parseable_goto_if_exists(struct ast_channel *chan, const char *goto_string); /*! * \note This function will handle locking the channel as needed. Index: apps/app_stack.c =================================================================== --- apps/app_stack.c (revision 172437) +++ apps/app_stack.c (working copy) @@ -107,7 +107,7 @@ u = ast_module_user_add(chan); snprintf(newlabel, sizeof(newlabel), "%s|%s|%d", chan->context, chan->exten, chan->priority + 1); - if (ast_parseable_goto(chan, data)) { + if (ast_parseable_goto_if_exists(chan, data)) { ast_module_user_remove(u); return -1; }