Askozia Forums
May 21, 2012, 09:03:07 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: pb13 Low Voicemail Volume  (Read 1583 times)
devon
Guest
« on: February 19, 2008, 05:53:53 am »

The volume of the voicemail .wav files is very low on incoming pstn calls.  I found some settings I would like to try in my zapata.conf file from the link below to change the channel gain.

bugs.digium.com/bug_view_page.php?bug_id=0002023

Is there a place in the webGUI or a practical way to do this?
Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #1 on: February 19, 2008, 07:13:57 am »

Nothing has been implemented in the webGUI yet but it seems something may need to be. The problem I see is that implementing the g() option in Voicemail() will not be straightforward because of the way the dialplan is currently generated.

Another option would be to adjust the gain for all analog pstn calls in zapata.conf with the following settings:

;
; You may also set the default receive and transmit gains (in dB)
;
rxgain=0.0
txgain=0.0


Logged
devon
Guest
« Reply #2 on: February 29, 2008, 06:39:43 am »

I've added dropdowns to select values for 'txgain' and 'rxgain' in 'interfaces_analog.php' so the values are included when zapata.conf is generated. It's been a huge  improvement in voicemail and pstn call volume for my system.

Screenshots:

Interfaces Analog
http://www.drivehq.com/file/df.aspx/publish/devon.hendricks/images/screenshots/interfaces_analog.php.JPG
Interfaces Analog Edit
http://www.drivehq.com/file/df.aspx/publish/devon.hendricks/images/screenshots/interfaces_analog_edit.php.JPG


Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #3 on: February 29, 2008, 08:05:45 am »

Looks nice!

svn diff?
Logged
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']);?>&nbsp;</td>
                <td class="listr"><?=htmlspecialchars($startsignal);?>&nbsp;</td>
                <td class="listr"><?
+                  if (!isset($mu['txgain']))
+                     $txgain = "0.0";
+                  else
+                     $txgain = $mu['txgain'];
+                  ?><?=htmlspecialchars($txgain);?>&nbsp;</td>
+               <td class="listr"><?
+                  if (!isset($mu['rxgain']))
+                     $rxgain = "0.0";
+                  else
+                     $rxgain = $mu['rxgain'];
+                  ?><?=htmlspecialchars($rxgain);?>&nbsp;</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">&nbsp;</td>
       <td>
          <span class="vexpl"><span class="red"><strong>Warning:<br>
-         </strong></span>clicking &quot;Save&quot; will drop all current
+         </strong></span>Clicking &quot;Save&quot; 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";
Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #5 on: March 03, 2008, 03:55:11 pm »

Thanks! I'll get it put in.
Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #6 on: March 06, 2008, 03:36:13 pm »

Committed: http://lists.askozia.com/pbx-commits/showmsg.php?id=0/53
Logged
devon
Guest
« Reply #7 on: March 06, 2008, 04:40:24 pm »

Very nice, I especially like the function "display_analog_gain_selector($current_rxgain, $current_txgain, $colspan)"; very elegant.  Makes my code look like a child's reading primer. Smiley
Logged
Michael
Askozia Staff
Hero Member
*

Karma: 49
Posts: 1020


View Profile
« Reply #8 on: March 07, 2008, 08:03:50 am »

Thanks for the kind words but I would take a peek at some of the uglies left over from pb1 before saying that again. Wink
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.121 seconds with 18 queries.