Index: apps/app_stack.c =================================================================== --- apps/app_stack.c (revision 188579) +++ apps/app_stack.c (working copy) @@ -337,6 +337,11 @@ return -1; } + if (!ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP)) { + ast_log(LOG_WARNING, "Gosub can't run without a dialplan, try Macro instead\n"); + return -1; + } + if (!stack_store) { ast_debug(1, "Channel %s has no datastore, so we're allocating one.\n", chan->name); stack_store = ast_datastore_alloc(&stack_info, NULL);