diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-13 03:26:04 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-13 03:26:04 +0000 |
commit | 11ea4709c8aaab73b20cb320711e255fb1af9869 (patch) | |
tree | f1508ed4bca962cc2140b39245baca9904a5f41d | |
parent | 7a17d3c4cc1dd814a73d396d20cc47f7107d0228 (diff) |
Merge in trunkrealloc option for chan_iax2. (issue #8267 reported by marcodmb, branch by anthonyl)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@50676 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | channels/chan_iax2.c | 9 | ||||
-rw-r--r-- | configs/iax.conf.sample | 4 |
3 files changed, 12 insertions, 2 deletions
@@ -60,6 +60,7 @@ Changes since Asterisk 1.4-beta was branched: what Asterisk should set as the maximum number of open files when it loads. * Added the jittertargetextra configuration option. * Added the URI redirect option for the built-in HTTP server + * Added the trunkrealloc configuration option to chan_iax2. SIP changes ----------- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index a1cba300a..cd355b805 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -165,6 +165,7 @@ static int resyncthreshold=1000; static int maxjitterinterps=10; static int jittertargetextra = 40; /* number of milliseconds the new jitter buffer adds on to its size */ static int trunkfreq = 20; +static int trunkrealloc = 0; static int authdebug = 1; static int autokill = 0; static int iaxcompat = 0; @@ -3649,7 +3650,7 @@ static int iax2_trunk_queue(struct chan_iax2_pvt *pvt, struct iax_frame *fr) if (tpeer) { if (tpeer->trunkdatalen + f->datalen + 4 >= tpeer->trunkdataalloc) { /* Need to reallocate space */ - if (tpeer->trunkdataalloc < MAX_TRUNKDATA) { + if (tpeer->trunkdataalloc < MAX_TRUNKDATA || trunkrealloc) { if (!(tmp = ast_realloc(tpeer->trunkdata, tpeer->trunkdataalloc + DEFAULT_TRUNKDATA + IAX2_TRUNK_PREFACE))) { ast_mutex_unlock(&tpeer->lock); return -1; @@ -8909,6 +8910,8 @@ static int set_config(char *config_file, int reload) maxauthreq = 3; + trunkrealloc = 0; + v = ast_variable_browse(cfg, "general"); /* Seed initial tos value */ @@ -9050,7 +9053,9 @@ static int set_config(char *config_file, int reload) global_max_trunk_mtu = mtuv; else ast_log(LOG_NOTICE, "trunkmtu value out of bounds (%d) at line %d\n", - mtuv, v->lineno); + mtuv, v->lineno); + } else if (!strcasecmp(v->name, "trunkrealloc")) { + trunkrealloc = ast_true(v->value); } else if (!strcasecmp(v->name, "autokill")) { if (sscanf(v->value, "%d", &x) == 1) { if (x >= 0) diff --git a/configs/iax.conf.sample b/configs/iax.conf.sample index afe25538c..000c1751a 100644 --- a/configs/iax.conf.sample +++ b/configs/iax.conf.sample @@ -172,6 +172,10 @@ forcejitterbuffer=no ; ; trunkmtu = 0 ; + +; Set the below option to yes to have the trunking size grow beyond the normal limit. +; trunkrealloc=yes + ; IAX helper threads ; Establishes the number of iax helper threads to handle I/O. |