IAXComm (actually, the IAXClient library) has a problem with occasionally missing incoming calls - it sees the "new call" packet, but never accepts the call and doesn't display an incoming call on the GUI.
The problem appears to be that the session is never removed from the sessions list when the call is hung up locally (it's fine if the remote end terminates the call). If a new call comes in with the same call numbers it finds the old session, gets confused and never accepts the call.
This patch causes the session to be destroyed as soon as the hangup packet is sent. I'm not entirely sure if that's quite the right thing to do - the ACK returned by the server doesn't match any session since it was destroyed immediately so it might be better to record the fact that the session is dieing and actually destroy it when the ACK is received.