[asterisk-commits] dbailey: trunk r61303 - /trunk/channels/chan_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Apr 10 15:02:54 MST 2007


Author: dbailey
Date: Tue Apr 10 17:02:53 2007
New Revision: 61303

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61303
Log:
Added zapata.conf parameter "cid_rxgain" to allow the user to adjust the gain bump used during CID acquisition.

Modified:
    trunk/channels/chan_zap.c

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=61303&r1=61302&r2=61303
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Tue Apr 10 17:02:53 2007
@@ -470,6 +470,7 @@
 	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 @@
 			.sig = -1,
 			.outsigmod = -1,
 
+			.cid_rxgain = +5.0,
+
 			.tonezone = -1,
 
 			.echocancel = 1,
@@ -1712,8 +1715,8 @@
 {
 	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 @@
 		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 @@
 			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);



More information about the asterisk-commits mailing list