diff options
author | Doug Bailey <dbailey@digium.com> | 2007-04-10 22:02:53 +0000 |
---|---|---|
committer | Doug Bailey <dbailey@digium.com> | 2007-04-10 22:02:53 +0000 |
commit | 7c9e46507b109b43e1a238a8d49fce5b6a4ef248 (patch) | |
tree | 1c24a1055b4b00be07a6c44153e8c8c257dbc0e4 /channels/chan_zap.c | |
parent | 74221823af982e64d2d45fd657b30fe199ad9984 (diff) |
Added zapata.conf parameter "cid_rxgain" to allow the user to adjust the gain bump used during CID acquisition.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r-- | channels/chan_zap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 0aa37a8b8..1563f6aa5 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -470,6 +470,7 @@ static struct zt_pvt { int outsigmod; /*!< Outbound Signalling style (modifier) */ int oprmode; /*!< "Operator Services" mode */ struct zt_pvt *oprpeer; /*!< "Operator Services" peer tech_pvt ptr */ + float cid_rxgain; /*!< "Gain to apply during caller id */ float rxgain; float txgain; int tonezone; /*!< tone zone for this chan, or -1 for default */ @@ -691,6 +692,8 @@ static struct zt_chan_conf zt_chan_conf_default(void) { .sig = -1, .outsigmod = -1, + .cid_rxgain = +5.0, + .tonezone = -1, .echocancel = 1, @@ -1712,8 +1715,8 @@ static int bump_gains(struct zt_pvt *p) { int res; - /* Bump receive gain by 5.0db */ - res = set_actual_gain(p->subs[SUB_REAL].zfd, 0, p->rxgain + 5.0, p->txgain, p->law); + /* Bump receive gain by value stored in cid_rxgain */ + res = set_actual_gain(p->subs[SUB_REAL].zfd, 0, p->rxgain + p->cid_rxgain, p->txgain, p->law); if (res) { ast_log(LOG_WARNING, "Unable to bump gain: %s\n", strerror(errno)); return -1; @@ -7870,6 +7873,7 @@ static struct zt_pvt *mkintf(int channel, struct zt_chan_conf conf, struct zt_pr tmp->group = conf.chan.group; tmp->callgroup = conf.chan.callgroup; tmp->pickupgroup= conf.chan.pickupgroup; + tmp->cid_rxgain = conf.chan.cid_rxgain; tmp->rxgain = conf.chan.rxgain; tmp->txgain = conf.chan.txgain; tmp->tonezone = conf.chan.tonezone; @@ -12050,6 +12054,10 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r confp->chan.immediate = ast_true(v->value); } else if (!strcasecmp(v->name, "transfertobusy")) { confp->chan.transfertobusy = ast_true(v->value); + } else if (!strcasecmp(v->name, "cid_rxgain")) { + if (sscanf(v->value, "%f", &confp->chan.cid_rxgain) != 1) { + ast_log(LOG_WARNING, "Invalid cid_rxgain: %s\n", v->value); + } } else if (!strcasecmp(v->name, "rxgain")) { if (sscanf(v->value, "%f", &confp->chan.rxgain) != 1) { ast_log(LOG_WARNING, "Invalid rxgain: %s\n", v->value); |