[asterisk-dev] IAX: why iax2_poke_noanswer timeout set to DEFAULT_MAXMS * 2 instead peer->pokefreqok?

Yousf Ateya y.ateya at starkbits.com
Mon Feb 23 14:25:52 CST 2015


I am investigating a problem happens in my setup. In which a trunk IAX
client becomes UNREACHABLE (peer->pokefreqnotok milliseconds) then return
OK again.

What happens in the following:
- client1 sends POKE to client2
- client2 sends PONG to client1
- PONG packet is dropped (don't reach client 1).
- After 4 seconds, client1 marks client2 as UNREACHABLE. *just for single
dropped PONG packet!*
- After peer->pokefreqnotok, client1 sends POKE again to client2
- client2 replies with PONG
- client1 sees PONG for his POKE, marks client as OK again.

Here is the code snippet which start iax2_pole_noanswer timer (asterisk

	/* Queue up a new task to handle no reply */
> 	/* If the host is already unreachable then use the unreachable interval instead */
> 	if (peer->lastms < 0)
> 		peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_noanswer, peer_ref(peer));
> 	else
> 		peer->pokeexpire = iax2_sched_add(sched, *DEFAULT_MAXMS * 2*, iax2_poke_noanswer, peer_ref(peer));
> Is it intended to have pokeexpire timer to fire after* DEFAULT_MAXMS * 2*
instead of *peer->pokefreqok *?

I think it is better to be:
- client1 sends POKE, wait for PONG.
- client2 sends PONG.
- If PONG packet is dropped retry it couple of times, until giving up.

Yousf Ateya,


This e-mail message is intended only for the use of the intended recipient(s).
The information contained therein may be confidential or privileged,
and its disclosure or reproduction is strictly prohibited.
If you are not the intended recipient, please return it immediately to its sender 
at the above address and destroy it. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150223/da173cac/attachment-0001.html>

More information about the asterisk-dev mailing list