[asterisk-dev] Bug with smoothing (chan_iax.c)?

Kris Boutilier Kris.Boutilier at scrd.bc.ca
Mon Feb 27 21:24:38 MST 2006

> -----Original Message-----
> From: asterisk-dev-bounces at lists.digium.com 
> [mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Rafael
Vidal Aroca
> Sent: Saturday, February 25, 2006 10:10 PM
> To: Asterisk Developers Mailing List
> Subject: [asterisk-dev] Bug with smoothing (chan_iax.c)?
>     Hi guys,
>     i was playing with some qualify options, and set the 
> following itens for a peer:
>     qualify=yes
>     qualifysmoothing=yes
>     qualifyfreqok=50000
>     qualifyfreqnotok=100
>     All the parameters were set, but not smoothing as the show peer
> displays:
> gaia*CLI> iax2 show peer 2004
>     .....
>   Status       : OK (40 ms)
>  Qualify        : every 50000 when OK, every 100 when UNREACHABLE 
> (sample smoothing Off)
>     Is it a bug? I'm using asteirsk 1.2.4, that i just got at asterisk

Well spotted, oops. 

This is a bug in the display of the configuration - the smoothing itself
is still happening. The patch to resolve this filed in

>     By the way, the smoothing option was supposed to solve this
>     Feb 26 03:06:20 NOTICE[28709]: chan_iax2.c:7775
iax2_poke_noanswer: Peer '2004' is now UNREACHABLE! Time: 34
>     Feb 26 03:06:20 NOTICE[28709]: chan_iax2.c:7105 socket_read: Peer
'2004' is now REACHABLE! Time: 31
>     isn't it?

Only in a limited fashion in its current implementation as it simply
takes the average of the last two pings. Eg. to handle the case where
the _occasional_ UDP packet is being discarded on a WAN link due to
congestion. The original behavior (fall over as soon as one IAX ping
goes astray) was just way too severe. If you're still getting peers
flapping then you'll need a better approach... this includes
fixing/upgrading the offending link. :-)

Otherwise, if someone is feeling creative they're welcome to implement a
variable length averaging buffer (or something more exotic) at lines
7117 through 7122 of chan_iax2.c

Kris Boutilier
Information Services Coordinator
Sunshine Coast Regional District

More information about the asterisk-dev mailing list