[svn-commits] branch bweschke/gain_functions r14424 -
/team/bweschke/gain_functions/funcs/
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Thu Mar 23 12:41:03 MST 2006
Author: bweschke
Date: Thu Mar 23 13:41:02 2006
New Revision: 14424
URL: http://svn.digium.com/view/asterisk?rev=14424&view=rev
Log:
Initial W/O support for rxgain/txgain on channels
Modified:
team/bweschke/gain_functions/funcs/func_channel.c
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=14424&r1=14423&r2=14424&view=diff
==============================================================================
--- team/bweschke/gain_functions/funcs/func_channel.c (original)
+++ team/bweschke/gain_functions/funcs/func_channel.c Thu Mar 23 13:41:02 2006
@@ -23,6 +23,7 @@
*/
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <sys/types.h>
@@ -86,12 +87,19 @@
char *data, const char *value)
{
int ret = 0;
+ signed char gainset;
if (!strcasecmp(data, "language"))
locked_string_field_set(chan, language, value);
else if (!strcasecmp(data, "musicclass"))
locked_string_field_set(chan, musicclass, value);
- else if (!chan->tech->func_channel_write
+ else if (!strcasecmp(data, "txgain")) {
+ sscanf(value, "%hhd", &gainset);
+ ast_channel_setoption(chan, AST_OPTION_TXGAIN, &gainset, sizeof(gainset), 0);
+ } else if (!strcasecmp(data, "rxgain")) {
+ sscanf(value, "%hhd", &gainset);
+ ast_channel_setoption(chan, AST_OPTION_RXGAIN, &gainset, sizeof(gainset), 0);
+ } else if (!chan->tech->func_channel_write
|| chan->tech->func_channel_write(chan, function, data, value)) {
ast_log(LOG_WARNING, "Unknown or unavailable item requested: '%s'\n",
data);
@@ -114,6 +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"
"\n"
"Additional items may be available from the channel driver providing\n"
"the channel; see its documentation for details.\n"
More information about the svn-commits
mailing list