From: Sean Bright Date: Fri, 17 Feb 2012 19:34:17 +0000 (+0000) Subject: Pass the correct value to ast_timer_set_rate() for IAX2 trunking. X-Git-Tag: 10.3.0-rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f41e7d4a446170c7a90b6e78bf69f61d55f72105;p=thirdparty%2Fasterisk.git Pass the correct value to ast_timer_set_rate() for IAX2 trunking. IAX2 uses the trunkfreq variable to determine how often to send trunk packets, but this value is in milliseconds while ast_timer_set_rate() expects the rate argument to be ticks per second. So we divide 1000 by trunkfreq and pass that in instead. With a default of 20ms, this change makes IAX2 send trunk packets every 20ms instead of every 50ms. Tracked down by myself and Bob Wienholt. ........ Merged revisions 355746 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@355747 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 55a124b962..3a8f4f4b76 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -14854,7 +14854,7 @@ static int load_module(void) jb_setoutput(jb_error_output, jb_warning_output, NULL); if ((timer = ast_timer_open())) { - ast_timer_set_rate(timer, trunkfreq); + ast_timer_set_rate(timer, 1000 / trunkfreq); } if (set_config(config, 0) == -1) {