[Asterisk-cvs] asterisk/channels chan_zap.c,1.347,1.348
citats at lists.digium.com
citats at lists.digium.com
Sat Oct 2 10:59:46 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/home/citats/cvs/asterisk/channels
Modified Files:
chan_zap.c
Log Message:
Allow PRI timers to be congfigurable. (bug 2518)
Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.347
retrieving revision 1.348
diff -u -d -r1.347 -r1.348
--- chan_zap.c 2 Oct 2004 00:58:31 -0000 1.347
+++ chan_zap.c 2 Oct 2004 15:01:37 -0000 1.348
@@ -244,6 +244,7 @@
static char idledial[AST_MAX_EXTENSION];
static int overlapdial = 0;
static struct ast_channel inuse = { "GR-303InUse" };
+static int pritimers[PRI_MAX_TIMERS];
#endif
/* Wait up to 16 seconds for first digit (FXO logic) */
@@ -8101,6 +8102,12 @@
}
pri_set_debug(pri->dchans[i], DEFAULT_PRI_DEBUG);
pri_set_nsf(pri->dchans[i], pri->nsf);
+#ifdef PRI_GETSET_TIMERS
+ for (x = 0; x < PRI_MAX_TIMERS; x++) {
+ if (pritimers[x] != 0)
+ pri_set_timer(pri->dchans[i], x, pritimers[x]);
+ }
+#endif
}
/* Assume primary is the one we use */
pri->pri = pri->dchans[0];
@@ -9496,7 +9503,26 @@
strncpy(idledial, v->value, sizeof(idledial) - 1);
} else if (!strcasecmp(v->name, "overlapdial")) {
overlapdial = ast_true(v->value);
-#endif
+ } else if (!strcasecmp(v->name, "pritimer")) {
+#ifdef PRI_GETSET_TIMERS
+ char *timerc;
+ int timer, timeridx;
+ c = v->value;
+ timerc = strsep(&c, ",");
+ if (timerc) {
+ timer = atoi(c);
+ if (!timer)
+ ast_log(LOG_WARNING, "'%s' is not a valid value for an ISDN timer\n", timerc);
+ else {
+ if ((timeridx = pri_timer2idx(timerc)))
+ pritimers[timeridx] = timer;
+ else
+ ast_log(LOG_WARNING, "'%s' is not a valid ISDN timer\n", timerc);
+ }
+ } else
+ ast_log(LOG_WARNING, "'%s' is not a valid ISDN timer configuration string\n", v->value);
+#endif /* PRI_GETSET_TIMERS */
+#endif /* ZAPATA_PRI */
} else if (!strcasecmp(v->name, "cadence")) {
/* setup to scan our argument */
int element_count, c[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
More information about the svn-commits
mailing list