chan_dahdi: Reflect the set software gain in the CLI "dahdi show channel" output.

* Remember the swgain setting from CLI "dahdi set swgain" command so the
CLI "dahdi show channel" output will reflect the current setting.

* Updated CLI "dahdi set hwgain" and "dahdi set swgain" documentation.

(issue ASTERISK-22429)
Reported by: Jaco Kroon
Patches:
      jira_asterisk_22429_v1.8_v2.patch (license #5621) patch uploaded by rmudgett
........

Merged revisions 400907 from http://svn.asterisk.org/svn/asterisk/branches/1.8


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@400909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/61/61/1
Richard Mudgett 12 years ago
parent 23b6a34d45
commit f46a73f1c4

@ -744,9 +744,9 @@ struct dahdi_pvt {
struct dahdi_pvt *oprpeer; /*!< "Operator Services" peer tech_pvt ptr */ struct dahdi_pvt *oprpeer; /*!< "Operator Services" peer tech_pvt ptr */
/*! \brief Amount of gain to increase during caller id */ /*! \brief Amount of gain to increase during caller id */
float cid_rxgain; float cid_rxgain;
/*! \brief Rx gain set by chan_dahdi.conf */ /*! \brief Software Rx gain set by chan_dahdi.conf */
float rxgain; float rxgain;
/*! \brief Tx gain set by chan_dahdi.conf */ /*! \brief Software Tx gain set by chan_dahdi.conf */
float txgain; float txgain;
float txdrc; /*!< Dynamic Range Compression factor. a number between 1 and 6ish */ float txdrc; /*!< Dynamic Range Compression factor. a number between 1 and 6ish */
@ -15975,15 +15975,20 @@ static char *dahdi_set_hwgain(struct ast_cli_entry *e, int cmd, struct ast_cli_a
switch (cmd) { switch (cmd) {
case CLI_INIT: case CLI_INIT:
e->command = "dahdi set hwgain"; e->command = "dahdi set hwgain {rx|tx}";
e->usage = e->usage =
"Usage: dahdi set hwgain <rx|tx> <chan#> <gain>\n" "Usage: dahdi set hwgain <rx|tx> <chan#> <gain>\n"
" Sets the hardware gain on a a given channel, overriding the\n" " Sets the hardware gain on a given channel. Changes take effect\n"
" value provided at module loadtime, whether the channel is in\n" " immediately whether the channel is in use or not.\n"
" use or not. Changes take effect immediately.\n" "\n"
" <rx|tx> which direction do you want to change (relative to our module)\n" " <rx|tx> which direction do you want to change (relative to our module)\n"
" <chan num> is the channel number relative to the device\n" " <chan num> is the channel number relative to the device\n"
" <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n"; " <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n"
"\n"
" Please note:\n"
" * This is currently the only way to set hwgain by the channel driver.\n"
" * hwgain is only supportable by hardware with analog ports because\n"
" hwgain works on the analog side of an analog-digital conversion.\n";
return NULL; return NULL;
case CLI_GENERATE: case CLI_GENERATE:
return NULL; return NULL;
@ -16044,12 +16049,13 @@ static char *dahdi_set_swgain(struct ast_cli_entry *e, int cmd, struct ast_cli_a
switch (cmd) { switch (cmd) {
case CLI_INIT: case CLI_INIT:
e->command = "dahdi set swgain"; e->command = "dahdi set swgain {rx|tx}";
e->usage = e->usage =
"Usage: dahdi set swgain <rx|tx> <chan#> <gain>\n" "Usage: dahdi set swgain <rx|tx> <chan#> <gain>\n"
" Sets the software gain on a a given channel, overriding the\n" " Sets the software gain on a given channel and overrides the\n"
" value provided at module loadtime, whether the channel is in\n" " value provided at module loadtime. Changes take effect\n"
" use or not. Changes take effect immediately.\n" " immediately whether the channel is in use or not.\n"
"\n"
" <rx|tx> which direction do you want to change (relative to our module)\n" " <rx|tx> which direction do you want to change (relative to our module)\n"
" <chan num> is the channel number relative to the device\n" " <chan num> is the channel number relative to the device\n"
" <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n"; " <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n";
@ -16093,6 +16099,12 @@ static char *dahdi_set_swgain(struct ast_cli_entry *e, int cmd, struct ast_cli_a
ast_cli(a->fd, "software %s gain set to %.1f on channel %d\n", ast_cli(a->fd, "software %s gain set to %.1f on channel %d\n",
tx ? "tx" : "rx", gain, channel); tx ? "tx" : "rx", gain, channel);
if (tx) {
tmp->txgain = gain;
} else {
tmp->rxgain = gain;
}
break; break;
} }
ast_mutex_unlock(&iflock); ast_mutex_unlock(&iflock);

Loading…
Cancel
Save