--- channels/chan_iax2.c.orig 2009-01-06 16:46:02.000000000 -0500 +++ channels/chan_iax2.c 2009-01-19 00:23:01.000000000 -0500 @@ -8179,6 +8179,18 @@ } 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); + } + } + } + } return 1; } if (ast_test_flag(iaxs[fr->callno], IAX_ENCRYPTED)) {