bkruse: branch 1.4 r1336 - in /branches/1.4/config: ./ scripts/
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Aug 14 18:08:57 CDT 2007
Author: bkruse
Date: Tue Aug 14 18:08:57 2007
New Revision: 1336
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1336
Log:
The beginning of digital card support. [1] Added ability to check if any spans are on the computer via /etc/asterisk/ztscan.conf (generated by ztscan.conf). [2] With this, it checks the general section of the file, and if continue=no, the gui will tell the user no spans were found, and give the option to redirect them to the digital.html page (under constructions) which will guide them through a setup of their spans (if they have any) [3] This is the first of a couple of commits having to deal with digital card detection, but it is looking very promising.
Modified:
branches/1.4/config/scripts/astman.js
branches/1.4/config/scripts/tooltip.js
branches/1.4/config/trunks.html
Modified: branches/1.4/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/config/scripts/astman.js?view=diff&rev=1336&r1=1335&r2=1336
==============================================================================
--- branches/1.4/config/scripts/astman.js (original)
+++ branches/1.4/config/scripts/astman.js Tue Aug 14 18:08:57 2007
@@ -33,6 +33,7 @@
var asterisk_guiSysInfo = "sh " + asterisk_scriptsFolder + "gui_sysinfo" ;
var asterisk_guiSysInfo_output = "./sysinfo_output.html";
var asterisk_guiZapscan = "/sbin/zapscan.bin" ;
+var asterisk_guiZtscan = "/sbin/ztscan";
var asterisk_rawmanPath = "../../rawman" ;
var asterisk_guiConfigFile = "guipreferences.conf"; // will be created in asterisk_configfolder, if the file does not exist
var asterisk_configfolder = "/etc/asterisk/";
Modified: branches/1.4/config/scripts/tooltip.js
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/config/scripts/tooltip.js?view=diff&rev=1336&r1=1335&r2=1336
==============================================================================
--- branches/1.4/config/scripts/tooltip.js (original)
+++ branches/1.4/config/scripts/tooltip.js Tue Aug 14 18:08:57 2007
@@ -255,6 +255,7 @@
tooltips['trunks'].en[2] = "<B>Lines:</B> Individual lines of the PBX Ex: Analog Port #3: The third analog port of the PBX.";
tooltips['trunks'].en[3] = "<B>Username:</B> The username for your account with the provider - please contact your provider if you do not know it.";
tooltips['trunks'].en[4] = "<B>Password:</B> The password for your account with the provider - please contact your provider if you do not know it.";
+ tooltips['trunks'].en[5] = "<B>Digital Cards:</B> Digital Card trunking setup includes TExxxx based cards. Anything that is based from zaptel.conf and zapata.conf is readily availible to be configured as a trunk.";
// Tooltips for Voicemenus (menus)
tooltips['menus']= new Object;
Modified: branches/1.4/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/config/trunks.html?view=diff&rev=1336&r1=1335&r2=1336
==============================================================================
--- branches/1.4/config/trunks.html (original)
+++ branches/1.4/config/trunks.html Tue Aug 14 18:08:57 2007
@@ -7,6 +7,7 @@
*
* Mark Spencer <markster at digium.com>
* Pari Nannapaneni <pari at digium.com>
+ * Brandon Kruse <bkruse at digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
@@ -27,17 +28,20 @@
var origwidth;
var widgets = {};
var provwidgets = {};
+var spanwidgets = {};
var callbacks = new Object;
var phonecallbacks = new Object;
var providercallbacks = new Object;
+var digitalcallbacks = new Object;
var globalvars = new Object;
var fieldnames =[ 'disallow','allow','callerid','cancel','contact','context','delete','dialformat','fromdomain','fromuser','group','hasexten','hasiax','hassip','host','insecure',
- 'name','new','port','provider','registeriax','registersip','save','secret','trunkname','trunkstyleanalog','trunkstylecustomvoip',
+ 'name','new','port','provider','registeriax','registersip','save','secret','trunkname','trunkstyleanalog','trunkstylecustomvoip', 'trunkstyledigital',
'trunkstylevoip','username','zapchan'];
var provfieldnames = ['providerdesc', 'providerlogo'];
var isnewtrunk;
var dids_array = [];
var old_trunkname;
+var has_spans;
var used_fxos = {};
used_fxos.oldvalue = "";
used_fxos.newvalue = "";
@@ -112,6 +116,7 @@
ASTGUI.events.remove( _$('trunkstyleanalog') , 'click' , activateanalogvoip );
ASTGUI.events.remove( _$('trunkstylevoip') , 'click' , activateanalogvoip );
ASTGUI.events.remove( _$('trunkstylecustomvoip') , 'click' , activateanalogvoip );
+ ASTGUI.events.remove( _$('trunkstyledigital') , 'click' , activateanalogvoip );
hideSPdetails();
}
@@ -126,7 +131,7 @@
ASTGUI.events.add( _$('new') , "click", showSPdetails ) ;
loadServiceProvidersintotable();
preparemenus();
- parent.loadscreen(this);
+ parent.astmanEngine.config2list("ztscan.conf", _$('spans'), new Array(), digitalcallbacks);
}
callbacks.postselect = function(){
@@ -169,6 +174,7 @@
var _tsv = _$('trunkstylevoip');
var _tsa = _$('trunkstyleanalog');
var _tscv = _$('trunkstylecustomvoip');
+ var _dig = _$('trunkstyledigital');
var _cv_un = _$('customvoip_username');
var _name = _$('name') ;
var _dvcs_v = _$('devices').value ;
@@ -426,11 +432,51 @@
ASTGUI.events.add( _$('trunkstyleanalog') , 'click' , activateanalogvoip );
ASTGUI.events.add( _$('trunkstylevoip') , 'click' , activateanalogvoip );
ASTGUI.events.add( _$('trunkstylecustomvoip') , 'click' , activateanalogvoip );
+ ASTGUI.events.add( _$('trunkstyledigital'), 'click', activateanalogvoip );
return tmp;
}
callbacks.identifier = "extension";
+
+function isInt(x) {
+ var y=parseInt(x);
+ if (isNaN(y)) return false;
+ return x==y && x.toString()==y.toString();
+}
+
+digitalcallbacks.format = function(t) {
+
+ if(t.name == "general") {
+ if(t.fieldbyname['continue'] == "no") {
+ has_spans = 0;
+ if(t.fieldbyname['error'].match('No Spans Found')) {
+ _$('digital_click_txt').innerHTML = "Click Here to go to the Digital Card setup Wizard";
+ _$('digital_click_txt').style.display = "";
+ ASTGUI.events.add(_$('digital_click_txt'), 'click', function() { window.location.href = "digital.html" } );
+
+ return "No Spans/Cards Found";
+ }
+ } else {
+ if(t.fieldbyname['continue'] == "yes")
+ return null;
+ }
+ }
+
+ var mode = (t.fieldbyname['totchans'] > 25) ? "E1" : "T1";
+ return "span: " + t.name + " Mode: " + mode;
+}
+
+digitalcallbacks.loaded = function() {
+
+ var spans = _$('spans').stored_config.catbyname['general'].fieldbyname['totalspans'];
+ if(spans > 0)
+ has_spans = 1;
+
+ parent.loadscreen(this);
+ return true;
+
+}
phonecallbacks.format = function(t) {
if (t.fieldbyname['port'] == 'fxs')
@@ -439,6 +485,7 @@
}
phonecallbacks.loaded = function() {
+ parent.astmanEngine.config2list("zapata.conf", _$('spans'), spanwidgets, digitalcallbacks);
parent.astmanEngine.config2list("providers.conf", _$('provider'), provwidgets, providercallbacks);
}
@@ -489,10 +536,21 @@
_$('voip').style.height =350;
}else if (_$('trunkstylecustomvoip').checked) {
_$('customvoip').style.display = "" ;
- }
+ }else if (_$('trunkstyledigital').checked) {
+ _$('digital').style.display = "" ;
+ _$('digital').style.height = 350;
+ _$('spans').style.display = "";
+ // _$('digital').innerHTML = "";
+ // _$('digital_click').innerHTML = "No Spans Found. Click Here to go to the Digital Card setup Wizard";
+ // _$('digital_click').style.display = "";
+ // ASTGUI.events.add(_$('digital_click'), 'click', function() { window.location.href = "digital.html" } );
+ //check_digital();
+ }
+
}
function localajaxinit() {
+ parent.astmanEngine.run_tool(asterisk_guiZtscan, onSuccess = function() { return true; });
ASTGUI.events.add(document, 'mouseover', show_tooltip);
ASTGUI.events.add( _$('customvoip_name') , 'change' , function(){ _$('trunkname').value = _$('customvoip_name').value; } );
@@ -589,6 +647,9 @@
break;
case "voip":
newCell2.innerHTML = "Voip";
+ break;
+ case "digital":
+ newCell2.innerHTML = "Digital";
break;
default :
newCell2.innerHTML = "?";
@@ -1006,6 +1067,7 @@
<LABEL FOR="trunkstyleanalog"><input name='trunkstyle' type='radio' id='trunkstyleanalog' value='analog'>Analog</LABEL><BR>
<LABEL FOR="trunkstylevoip"><input name='trunkstyle' type='radio' id='trunkstylevoip' value='voip'>VoIP</LABEL><BR>
<LABEL FOR="trunkstylecustomvoip"><input name='trunkstyle' type='radio' id='trunkstylecustomvoip' value='customvoip'>Custom VoIP</LABEL>
+ <LABEL FOR="trunkstyledigital"><input name='trunkstyle' type='radio' id='trunkstyledigital' tip="en,trunks,5" value='digital'>(BETA!) Digital Cards(T1/E1/J1)</LABEL>
</fieldset>
<div id="div_providername" style="display:none">
<BR><BR><B>Provider Name:</B><BR><input id="name" size=10 class='input8'>
@@ -1023,6 +1085,15 @@
</td>
</tr>
<tr><td colspan='2' style='width:80px' valign='top' align='center'></td></tr>
+ </table>
+</div>
+<div id='digital' style='height:0;overflow:hidden' align="center">
+ <table align="center">
+ <td style='width:120px' valign='top' class='field_text' tip="en,trunks,5">Spans:</td>
+ <td style='width:120px;display:none;color:#0000FF' valign='top' id='digital_click_txt' class='field_text' tip="en,trunks,5"></td>
+ <br><br>
+ <td><select size='12' style="display:none" id='spans' style='width:240px' class='input8'><option name="blah" value="blah"></option></select></td>
+ </tr>
</table>
</div>
<div id='voip' style='height:0;overflow:hidden' align="center">
More information about the asterisk-gui-commits
mailing list