[asterisk-commits] tilghman: branch 1.6.0 r127298 - in /branches/1.6.0: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 1 21:49:58 CDT 2008


Author: tilghman
Date: Tue Jul  1 21:49:57 2008
New Revision: 127298

URL: http://svn.digium.com/view/asterisk?view=rev&rev=127298
Log:
Merged revisions 127297 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r127297 | tilghman | 2008-07-01 21:48:43 -0500 (Tue, 01 Jul 2008) | 12 lines

Change the global timer B to be dependent on the value of the T1 timer, as
recommended in RFC 3261, instead of being hardcoded to 32 seconds.  This is
important for LANs, as it allows autocongestion to occur much more quickly, if
desired by the local PBX administrator.  It also corrects a bug: if the T1
timer was increased beyond 500ms, then timer B would have been set at a much
lower value than recommended.
(closes issue #12544)
 Reported by: kactus
 Patches: 
       20080616__bug12544.diff.txt uploaded by Corydon76 (license 14)
 Tested by: kactus

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=127298&r1=127297&r2=127298
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Tue Jul  1 21:49:57 2008
@@ -20106,10 +20106,21 @@
 				ast_log(LOG_WARNING, "'%s' is not a valid T1 time at line %d.  Using default.\n", v->value, v->lineno);
 				peer->timer_t1 = global_t1;
 			}
+			/* Note that Timer B is dependent upon T1 and MUST NOT be lower
+			 * than T1 * 64, according to RFC 3261, Section 17.1.1.2 */
+			if (peer->timer_b < peer->timer_t1 * 64) {
+				peer->timer_b = peer->timer_t1 * 64;
+			}
 		} else if (!strcasecmp(v->name, "timerb")) {
 			if ((sscanf(v->value, "%d", &peer->timer_b) != 1) || (peer->timer_b < 0)) {
 				ast_log(LOG_WARNING, "'%s' is not a valid Timer B time at line %d.  Using default.\n", v->value, v->lineno);
 				peer->timer_b = global_timer_b;
+			}
+			if (peer->timer_b < peer->timer_t1 * 64) {
+				static int warning = 0;
+				if (warning++ % 20 == 0) {
+					ast_log(LOG_WARNING, "Timer B has been set lower than recommended. (RFC 3261, 17.1.1.2)\n");
+				}
 			}
 		} else if (!strcasecmp(v->name, "setvar")) {
 			peer->chanvars = add_var(v->value, peer->chanvars);
@@ -20476,6 +20487,13 @@
 			sip_cfg.peer_rtupdate = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "ignoreregexpire")) {
 			sip_cfg.ignore_regexpire = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "timert1")) {
+			/* Defaults to 500ms, but RFC 3261 states that it is recommended
+			 * for the value to be set higher, though a lower value is only
+			 * allowed on private networks unconnected to the Internet. */
+			global_t1 = atoi(v->value);
+			/* Note that timer B is dependent on the value of T1 */
+			global_timer_b = global_t1 * 64;
 		} else if (!strcasecmp(v->name, "t1min")) {
 			global_t1min = atoi(v->value);
 		} else if (!strcasecmp(v->name, "tcpenable")) {




More information about the asterisk-commits mailing list