[asterisk-commits] branch bweschke/gain_functions r14520 - in /team/bweschke/gain_functions: cha...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 23 14:36:04 MST 2006


Author: bweschke
Date: Thu Mar 23 15:36:03 2006
New Revision: 14520

URL: http://svn.digium.com/view/asterisk?rev=14520&view=rev
Log:
 Enabling READ of R/W for txgain/rxgain for chan_zap channels.


Modified:
    team/bweschke/gain_functions/channels/chan_zap.c
    team/bweschke/gain_functions/funcs/func_channel.c

Modified: team/bweschke/gain_functions/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/gain_functions/channels/chan_zap.c?rev=14520&r1=14519&r2=14520&view=diff
==============================================================================
--- team/bweschke/gain_functions/channels/chan_zap.c (original)
+++ team/bweschke/gain_functions/channels/chan_zap.c Thu Mar 23 15:36:03 2006
@@ -721,7 +721,7 @@
 static int zt_indicate(struct ast_channel *chan, int condition);
 static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
 static int zt_setoption(struct ast_channel *chan, int option, void *data, int datalen);
-/*static int zt_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len); */
+static int zt_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len); 
 
 static const struct ast_channel_tech zap_tech = {
 	.type = "Zap",
@@ -740,6 +740,7 @@
 	.indicate = zt_indicate,
 	.fixup = zt_fixup,
 	.setoption = zt_setoption,
+	.func_channel_read = zt_func_read,
 };
 
 #ifdef ZAPATA_PRI
@@ -2953,6 +2954,25 @@
 
 	return 0;
 }
+
+static int zt_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len)
+{
+	struct zt_pvt *p = chan->tech_pvt;
+	
+	if (!strcasecmp(data, "rxgain")) {
+		ast_mutex_lock(&p->lock);
+		snprintf(buf, len, "%f", p->rxgain);
+		ast_mutex_unlock(&p->lock);	
+	} else if (!strcasecmp(data, "txgain")) {
+		ast_mutex_lock(&p->lock);
+		snprintf(buf, len, "%f", p->txgain);
+		ast_mutex_unlock(&p->lock);	
+	} else {
+		ast_copy_string(buf, "", len);
+	}
+	return 0;
+}
+
 
 static void zt_unlink(struct zt_pvt *slave, struct zt_pvt *master, int needlock)
 {

Modified: team/bweschke/gain_functions/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/gain_functions/funcs/func_channel.c?rev=14520&r1=14519&r2=14520&view=diff
==============================================================================
--- team/bweschke/gain_functions/funcs/func_channel.c (original)
+++ team/bweschke/gain_functions/funcs/func_channel.c Thu Mar 23 15:36:03 2006
@@ -122,8 +122,8 @@
 		"R/W	musicclass 		class (from musiconhold.conf) for hold music\n"
 		"R/O	tonezone 		zone for indications played\n"
 		"R/O	videonativeformat 	format used natively for video\n"
-		"W/O	txgain			set txgain level on channel techs that support it\n"
-		"W/O	rxgain			set rxgain level on channel techs that support it\n"
+		"R/W	txgain			set txgain level on channel techs that support it\n"
+		"R/W	rxgain			set rxgain level on channel techs that support it\n"
 		"\n"
 		"Additional items may be available from the channel driver providing\n"
 		"the channel; see its documentation for details.\n"



More information about the asterisk-commits mailing list