diff options
author | jim <jim@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-02-15 07:35:32 +0000 |
---|---|---|
committer | jim <jim@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-02-15 07:35:32 +0000 |
commit | 332a7d5a3f1a578569890cbee99335c98375ea46 (patch) | |
tree | 7ff372d735edf76e7287b2c655fa42156a94ff8f /channels | |
parent | 420ccd47829d8eb4d6bf5df806ff4d35a4fc346b (diff) |
Added support for specifing Zaptel tonezone on a per-channel basis for
Zaptel channels in zaptel.conf (using tonezone= parameter)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2173 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_zap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 92531af38..355057329 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -174,6 +174,8 @@ static float rxgain = 0.0; static float txgain = 0.0; +static int tonezone = -1; + static int echocancel; static int echotraining; @@ -384,6 +386,7 @@ static struct zt_pvt { int firstradio; /* first radio flag */ float rxgain; float txgain; + int tonezone; /* tone zone for this chan, or -1 for default */ struct zt_pvt *next; /* Next channel in list */ struct zt_pvt *prev; /* Prev channel in list */ @@ -5535,6 +5538,7 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio) tmp->pickupgroup=cur_pickupgroup; tmp->rxgain = rxgain; tmp->txgain = txgain; + tmp->tonezone = tonezone; tmp->onhooktime = time(NULL); if (tmp->subs[SUB_REAL].zfd > -1) { set_actual_gain(tmp->subs[SUB_REAL].zfd, 0, tmp->rxgain, tmp->txgain, tmp->law); @@ -5546,6 +5550,7 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio) /* Hang it up to be sure it's good */ zt_set_hook(tmp->subs[SUB_REAL].zfd, ZT_ONHOOK); } + ioctl(tmp->subs[SUB_REAL].zfd,ZT_SETTONEZONE,&tmp->tonezone); #ifdef ZAPATA_PRI /* the dchannel is down so put the channel in alarm */ if (tmp->pri && tmp->pri->up == 0) @@ -7423,6 +7428,10 @@ static int setup_zap(void) if (sscanf(v->value, "%f", &txgain) != 1) { ast_log(LOG_WARNING, "Invalid txgain: %s\n", v->value); } + } else if (!strcasecmp(v->name, "tonezone")) { + if (sscanf(v->value, "%d", &tonezone) != 1) { + ast_log(LOG_WARNING, "Invalid tonezone: %s\n", v->value); + } } else if (!strcasecmp(v->name, "callerid")) { if (!strcasecmp(v->value, "asreceived")) strcpy(callerid,""); @@ -7719,6 +7728,7 @@ static int reload_zt(void) transfer = 0; rxgain = 0.0; txgain = 0.0; + tonezone = -1; firstdigittimeout = 16000; gendigittimeout = 8000; amaflags = 0; @@ -7879,6 +7889,10 @@ static int reload_zt(void) if (sscanf(v->value, "%f", &txgain) != 1) { ast_log(LOG_WARNING, "Invalid txgain: %s\n", v->value); } + } else if (!strcasecmp(v->name, "tonezone")) { + if (sscanf(v->value, "%d", &tonezone) != 1) { + ast_log(LOG_WARNING, "Invalid tonezone: %s\n", v->value); + } } else if (!strcasecmp(v->name, "callerid")) { if (!strcasecmp(v->value, "asreceived")) strcpy(callerid,""); |