From 0106636e42d34831fcb0decda4dd162493387f35 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Fri, 17 Feb 2012 22:01:49 +0000 Subject: [PATCH] Don't allow trunkfreq to be greater than 1000ms. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@355793 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_iax2.c | 7 ++++++- configs/iax.conf.sample | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 8af8fbb6ac..69723e5af4 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -13227,8 +13227,13 @@ static int set_config(const char *config_file, int reload) ast_set2_flag64((&globalflags), i || ast_true(v->value), IAX_RTAUTOCLEAR); } else if (!strcasecmp(v->name, "trunkfreq")) { trunkfreq = atoi(v->value); - if (trunkfreq < 10) + if (trunkfreq < 10) { + ast_log(LOG_NOTICE, "trunkfreq must be between 10ms and 1000ms, using 10ms instead.\n"); trunkfreq = 10; + } else if (trunkfreq > 1000) { + ast_log(LOG_NOTICE, "trunkfreq must be between 10ms and 1000ms, using 1000ms instead.\n"); + trunkfreq = 1000; + } } else if (!strcasecmp(v->name, "trunkmtu")) { mtuv = atoi(v->value); if (mtuv == 0 ) diff --git a/configs/iax.conf.sample b/configs/iax.conf.sample index a3d0fea127..ec7de832eb 100644 --- a/configs/iax.conf.sample +++ b/configs/iax.conf.sample @@ -189,7 +189,8 @@ forcejitterbuffer=no ; increasing the time between sending trunk messages, the trunk's payload size will increase as ; well. Note, depending on the size set by trunkmtu, messages may be sent more often than ; specified. For example if a trunk's message size grows to the trunkmtu size before 20ms is -; reached that message will be sent immediately. +; reached that message will be sent immediately. Acceptable values are between 10ms and +; 1000ms. ; ; trunkfreq=20 ; How frequently to send trunk msgs (in ms). This is 20ms by default. -- 2.47.3