Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 243115) +++ apps/app_dial.c (working copy) @@ -2427,7 +2427,7 @@ strcpy(peer->context, chan->context); - if (ast_test_flag64(&opts, OPT_PEER_H) && ast_exists_extension(peer, peer->context, "h", 1, peer->cid.cid_num)) { + if (!ast_test_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN) && ast_test_flag64(&opts, OPT_PEER_H) && ast_exists_extension(peer, peer->context, "h", 1, peer->cid.cid_num)) { int autoloopflag; int found; int res9; Index: main/features.c =================================================================== --- main/features.c (revision 243115) +++ main/features.c (working copy) @@ -3055,7 +3055,7 @@ char save_exten[AST_MAX_EXTENSION]; int save_prio; int found = 0; /* set if we find at least one match */ - int spawn_error = 0; + int spawn_error = 0, was_hungup = ast_check_hangup(chan); autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP); ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP); @@ -3079,8 +3079,11 @@ while ((spawn_error = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num, &found, 1)) == 0) { chan->priority++; } - if (spawn_error && (!ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num) || ast_check_hangup(chan))) { - /* if the extension doesn't exist or a hangup occurred, this isn't really a spawn error */ + if (spawn_error && (!ast_exists_extension(chan, chan->context, chan->exten, 1, chan->cid.cid_num) || (!was_hungup && ast_check_hangup(chan)))) { + /* If the extension doesn't exist or a hangup occurred in the short + * timeframe (remember, we're in the "h" extension, so to a very + * large margin, hangup occurred well before this point), this isn't + * really a spawn error. */ spawn_error = 0; } if (found && spawn_error) {