--- channels/chan_iax2.c.orig 2009-01-06 16:46:02.000000000 -0500 +++ channels/chan_iax2.c 2009-01-19 01:36:16.000000000 -0500 @@ -8179,6 +8179,24 @@ } if (fr->callno > 0) ast_mutex_unlock(&iaxsl[fr->callno]); + else { + if (f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_INVAL && + iaxs[dcallno]->peerpoke) { + peer = iaxs[dcallno]->peerpoke; + if (peer->pokeexpire > -1) { + if (!ast_sched_del(sched, peer->pokeexpire)) { + peer->pokeexpire = -1; + peer_unref(peer); + } + /* Now schedule another poke */ + peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqok, iax2_poke_peer_s, peer_ref(peer)); + if (peer->pokeexpire == -1) + peer_unref(peer); + } + iax2_destroy(dcallno); + peer->callno = 0; + } + } return 1; } if (ast_test_flag(iaxs[fr->callno], IAX_ENCRYPTED)) {