Index: main/pbx.c =================================================================== --- main/pbx.c (revision 75399) +++ main/pbx.c (working copy) @@ -2409,6 +2409,7 @@ break; } ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name); + ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING); if (option_verbose > 1) ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name); if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { @@ -2520,6 +2521,8 @@ } if (!found && !error) ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name); + if (res != AST_PBX_KEEPALIVE) + ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING); if ((res != AST_PBX_KEEPALIVE) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) { if (c->cdr && ast_opt_end_cdr_before_h_exten) ast_cdr_end(c->cdr);