|
devon
Guest
|
 |
« Reply #4 on: March 02, 2008, 06:08:42 pm » |
|
Index: webgui/interfaces_analog.php =================================================================== --- webgui/interfaces_analog.php (revision 427) +++ webgui/interfaces_analog.php (working copy) @@ -47,6 +47,8 @@ $configured_units[$interface['unit']]['name'] = $interface['name']; $configured_units[$interface['unit']]['type'] = $interface['type']; $configured_units[$interface['unit']]['startsignal'] = $interface['startsignal']; + $configured_units[$interface['unit']]['txgain'] = $interface['txgain']; + $configured_units[$interface['unit']]['rxgain'] = $interface['rxgain']; $configured_units[$interface['unit']]['echocancel'] = $interface['echocancel']; } @@ -67,12 +69,16 @@ $merged_units[$i]['name'] = $configured_units[$i]['name']; $merged_units[$i]['type'] = $configured_units[$i]['type']; $merged_units[$i]['startsignal'] = $configured_units[$i]['startsignal']; + $merged_units[$i]['txgain'] = $configured_units[$i]['txgain']; + $merged_units[$i]['rxgain'] = $configured_units[$i]['rxgain']; $merged_units[$i]['echocancel'] = $configured_units[$i]['echocancel']; } else { $merged_units[$i]['unit'] = $i; $merged_units[$i]['name'] = "(unconfigured)"; $merged_units[$i]['type'] = $recognized_units[$i]; $merged_units[$i]['startsignal'] = "ks"; + $merged_units[$i]['txgain'] = "0.0"; + $merged_units[$i]['rxgain'] = "0.0"; $merged_units[$i]['echocancel'] = "128"; } } @@ -137,6 +143,8 @@ <td width="30%" class="listhdrr">Name</td> <td width="15%" class="listhdrr">Type</td> <td width="20%" class="listhdrr">Start</td> + <td width="10%" class="listhdrr">TX Gain</td> + <td width="10%" class="listhdrr">RX Gain</td> <td width="20%" class="listhdrr">Echo Canceller</td> <td width="5%" class="list"></td> </tr><? @@ -155,6 +163,18 @@ <td class="listr"><?=htmlspecialchars($mu['type']);?> </td> <td class="listr"><?=htmlspecialchars($startsignal);?> </td> <td class="listr"><? + if (!isset($mu['txgain'])) + $txgain = "0.0"; + else + $txgain = $mu['txgain']; + ?><?=htmlspecialchars($txgain);?> </td> + <td class="listr"><? + if (!isset($mu['rxgain'])) + $rxgain = "0.0"; + else + $rxgain = $mu['rxgain']; + ?><?=htmlspecialchars($rxgain);?> </td> + <td class="listr"><? if (!isset($mu['echocancel'])) $ecfield = "128"; else if ($mu['echocancel'] == "no") Index: webgui/interfaces_analog_edit.php =================================================================== --- webgui/interfaces_analog_edit.php (revision 427) +++ webgui/interfaces_analog_edit.php (working copy) @@ -52,6 +52,8 @@ $configured_units[$interface['unit']]['name'] = $interface['name']; $configured_units[$interface['unit']]['type'] = $interface['type']; $configured_units[$interface['unit']]['startsignal'] = $interface['startsignal']; + $configured_units[$interface['unit']]['txgain'] = $interface['txgain']; + $configured_units[$interface['unit']]['rxgain'] = $interface['rxgain']; $configured_units[$interface['unit']]['echocancel'] = $interface['echocancel']; } @@ -72,6 +74,8 @@ $merged_units[$i]['name'] = $configured_units[$i]['name']; $merged_units[$i]['type'] = $configured_units[$i]['type']; $merged_units[$i]['startsignal'] = $configured_units[$i]['startsignal']; + $merged_units[$i]['txgain'] = $configured_units[$i]['txgain']; + $merged_units[$i]['rxgain'] = $configured_units[$i]['rxgain']; $merged_units[$i]['echocancel'] = $configured_units[$i]['echocancel']; } else { $merged_units[$i]['unit'] = $i; @@ -86,6 +90,8 @@ $pconfig['name'] = $merged_units[$unit]['name']; $pconfig['type'] = $merged_units[$unit]['type']; $pconfig['startsignal'] = $merged_units[$unit]['startsignal']; +$pconfig['txgain'] = $merged_units[$unit]['txgain']; +$pconfig['rxgain'] = $merged_units[$unit]['rxgain']; $pconfig['echocancel'] = $merged_units[$unit]['echocancel'] ? $merged_units[$unit]['echocancel'] : "128"; @@ -103,6 +109,8 @@ $a_abinterfaces[$i]['name'] = $_POST['name']; $a_abinterfaces[$i]['type'] = $_POST['type']; $a_abinterfaces[$i]['startsignal'] = ($_POST['startsignal'] != "ks") ? $_POST['startsignal'] : false; + $a_abinterfaces[$i]['txgain'] = ($_POST['txgain'] != "0.0") ? $_POST['txgain'] : false; + $a_abinterfaces[$i]['rxgain'] = ($_POST['rxgain'] != "0.0") ? $_POST['rxgain'] : false; $a_abinterfaces[$i]['echocancel'] = ($_POST['echocancel'] != "128") ? $_POST['echocancel'] : false; } } @@ -112,6 +120,8 @@ $a_abinterfaces[$n]['name'] = $_POST['name']; $a_abinterfaces[$n]['type'] = $_POST['type']; $a_abinterfaces[$n]['startsignal'] = ($_POST['startsignal'] != "ks") ? $_POST['startsignal'] : false; + $a_abinterfaces[$n]['txgain'] = ($_POST['txgain'] != "0.0") ? $_POST['txgain'] : false; + $a_abinterfaces[$n]['rxgain'] = ($_POST['rxgain'] != "0.0") ? $_POST['rxgain'] : false; $a_abinterfaces[$n]['echocancel'] = ($_POST['echocancel'] != "128") ? $_POST['echocancel'] : false; } @@ -133,7 +143,7 @@ <td width="20%" valign="top" class="vncellreq">Name</td> <td width="80%" class="vtable"> <input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>"> - <br><span class="vexpl">descriptive name</span> + <br><span class="vexpl">Descriptive name for this interface.</span> </td> </tr> <tr> @@ -151,6 +161,44 @@ </td> </tr> <tr> + <td valign="top" class="vncell">TX Gain</td> + <td class="vtable"> + <select name="txgain" class="formfld" id="txgain"> + <option value="0.0" <? if ($pconfig['txgain'] == "0.0") echo "selected"; ?>>0.0</option> + <option value="1.0" <? if ($pconfig['txgain'] == "1.0") echo "selected"; ?>>1.0</option> + <option value="2.0" <? if ($pconfig['txgain'] == "2.0") echo "selected"; ?>>2.0</option> + <option value="3.0" <? if ($pconfig['txgain'] == "3.0") echo "selected"; ?>>3.0</option> + <option value="4.0" <? if ($pconfig['txgain'] == "4.0") echo "selected"; ?>>4.0</option> + <option value="5.0" <? if ($pconfig['txgain'] == "5.0") echo "selected"; ?>>5.0</option> + <option value="6.0" <? if ($pconfig['txgain'] == "6.0") echo "selected"; ?>>6.0</option> + <option value="7.0" <? if ($pconfig['txgain'] == "7.0") echo "selected"; ?>>7.0</option> + <option value="8.0" <? if ($pconfig['txgain'] == "8.0") echo "selected"; ?>>8.0</option> + <option value="9.0" <? if ($pconfig['txgain'] == "9.0") echo "selected"; ?>>9.0</option> + <option value="10.0" <? if ($pconfig['txgain'] == "10.0") echo "selected"; ?>>10.0</option> + </select> + <br><span class="vexpl">Sets the gain of the audio signal being sent through the phone line.</span> + </td> + </tr> + <tr> + <td valign="top" class="vncell">RX Gain</td> + <td class="vtable"> + <select name="rxgain" class="formfld" id="rxgain"> + <option value="0.0" <? if ($pconfig['rxgain'] == "0.0") echo "selected"; ?>>0.0</option> + <option value="1.0" <? if ($pconfig['rxgain'] == "1.0") echo "selected"; ?>>1.0</option> + <option value="2.0" <? if ($pconfig['rxgain'] == "2.0") echo "selected"; ?>>2.0</option> + <option value="3.0" <? if ($pconfig['rxgain'] == "3.0") echo "selected"; ?>>3.0</option> + <option value="4.0" <? if ($pconfig['rxgain'] == "4.0") echo "selected"; ?>>4.0</option> + <option value="5.0" <? if ($pconfig['rxgain'] == "5.0") echo "selected"; ?>>5.0</option> + <option value="6.0" <? if ($pconfig['rxgain'] == "6.0") echo "selected"; ?>>6.0</option> + <option value="7.0" <? if ($pconfig['rxgain'] == "7.0") echo "selected"; ?>>7.0</option> + <option value="8.0" <? if ($pconfig['rxgain'] == "8.0") echo "selected"; ?>>8.0</option> + <option value="9.0" <? if ($pconfig['rxgain'] == "9.0") echo "selected"; ?>>9.0</option> + <option value="10.0" <? if ($pconfig['rxgain'] == "10.0") echo "selected"; ?>>10.0</option> + </select> + <br><span class="vexpl">Sets the gain of the audio signal being received through the phone line.</span> + </td> + </tr> + <tr> <td valign="top" class="vncell">Echo Canceller</td> <td class="vtable"> <select name="echocancel" class="formfld" id="echocancel"> @@ -175,7 +223,7 @@ <td valign="top"> </td> <td> <span class="vexpl"><span class="red"><strong>Warning:<br> - </strong></span>clicking "Save" will drop all current + </strong></span>Clicking "Save" will drop all current calls.</span> </td> </tr> Index: phpconf/inc/globals.inc =================================================================== --- phpconf/inc/globals.inc (revision 427) +++ phpconf/inc/globals.inc (working copy) @@ -62,6 +62,8 @@ $defaults['analog']['interface'] = array(); $defaults['analog']['interface']['name'] = "(unconfigured)"; $defaults['analog']['interface']['startsignal'] = "ks"; +$defaults['analog']['interface']['txgain'] = "0.0"; +$defaults['analog']['interface']['rxgain'] = "0.0"; $defaults['analog']['interface']['echocancel'] = "128"; $defaults['analog']['loadzone'] = array("us"); Index: phpconf/inc/analog.inc =================================================================== --- phpconf/inc/analog.inc (revision 427) +++ phpconf/inc/analog.inc (working copy) @@ -335,20 +335,28 @@ $analogproviders = analog_get_providers(); foreach ($analogproviders as $p) { $interface = analog_get_ab_interface($p['interface']); - + if ($interface['startsignal']) { $conf .= "signalling=fxs_{$interface['startsignal']}\n"; } else { $conf .= "signalling=fxs_ks\n"; } - + + if ($interface['txgain']) { + $conf .= "txgain={$interface['txgain']}\n"; + } + + if ($interface['rxgain']) { + $conf .= "rxgain={$interface['rxgain']}\n"; + } + if ($interface['echocancel']) { $conf .= "echocancel={$interface['echocancel']}\n"; } else { $conf .= "echocancel=128\n"; } + $conf .= "echocancelwhenbridged=no\n"; - $conf .= "busydetect=yes\n"; $conf .= "busycount=3\n"; @@ -357,6 +365,7 @@ } else { $conf .= "language={$p['language']}\n"; } + $conf .= "context={$p['uniqid']}-incoming\n"; $conf .= "channel => {$p['interface']}\n"; $conf .= "\n"; @@ -367,20 +376,28 @@ $interface = analog_get_ab_interface($p['interface']); $conf .= "callerid={$p['callerid']} <{$p['extension']}>\n"; - + if ($interface['startsignal']) { $conf .= "signalling=fxo_{$interface['startsignal']}\n"; } else { $conf .= "signalling=fxo_ks\n"; } - + + if ($interface['txgain']) { + $conf .= "txgain={$interface['txgain']}\n"; + } + + if ($interface['rxgain']) { + $conf .= "rxgain={$interface['rxgain']}\n"; + } + if ($interface['echocancel']) { $conf .= "echocancel={$interface['echocancel']}\n"; } else { $conf .= "echocancel=128\n"; } + $conf .= "echocancelwhenbridged=no\n"; - $conf .= "busydetect=yes\n"; $conf .= "busycount=3\n"; @@ -389,6 +406,7 @@ } else { $conf .= "language={$p['language']}\n"; } + $conf .= "context={$p['uniqid']}\n"; $conf .= "channel => {$p['interface']}\n"; $conf .= "\n";
|