bkruse: branch bkruse/dahdi_integration r3955 - /team/bkruse/dahdi_integratio...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Oct 7 15:52:32 CDT 2008
Author: bkruse
Date: Tue Oct 7 15:52:32 2008
New Revision: 3955
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3955
Log:
More dahdi integration. Fixed up the analog hardware page.
Modified:
team/bkruse/dahdi_integration/config/trunks_analog.html
Modified: team/bkruse/dahdi_integration/config/trunks_analog.html
URL: http://svn.digium.com/view/asterisk-gui/team/bkruse/dahdi_integration/config/trunks_analog.html?view=diff&rev=3955&r1=3954&r2=3955
==============================================================================
--- team/bkruse/dahdi_integration/config/trunks_analog.html (original)
+++ team/bkruse/dahdi_integration/config/trunks_analog.html Tue Oct 7 15:52:32 2008
@@ -34,7 +34,12 @@
</style>
<script>
-var zapchan_Before = '';
+
+if (parent.sessionData.PLATFORM.isAST_1_6) {
+ var dahdichan_Before = '';
+} else {
+ var zapchan_Before = '';
+}
var FXOS = [];
var isNew ;
var EDIT_TRUNK;
@@ -61,7 +66,11 @@
var c = parent.astgui_managetrunks.listOfAnalogTrunks();
c.each(function(item){
if(trunk && trunk == item ) return;
- used = used.concat( ASTGUI.miscFunctions.chanStringToArray(parent.sessionData.pbxinfo['trunks']['analog'][item]['zapchan']) ) ;
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ used = used.concat( ASTGUI.miscFunctions.chanStringToArray(parent.sessionData.pbxinfo['trunks']['analog'][item]['dahdichan']) ) ;
+ } else {
+ used = used.concat( ASTGUI.miscFunctions.chanStringToArray(parent.sessionData.pbxinfo['trunks']['analog'][item]['zapchan']) ) ;
+ }
});
ASTGUI.domActions.unCheckAll( ch_chkbxClass );
ASTGUI.domActions.disableSelected(ch_chkbxClass, used);
@@ -71,7 +80,11 @@
var new_analogTrunk_form = function(){
isNew = true;
EDIT_TRUNK = '';
- zapchan_Before = '';
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ dahdichan_Before = '';
+ } else {
+ zapchan_Before = '';
+ }
disable_usedChannels();
_$('new_ATRNK_DIV_title').innerHTML = 'New Analog Trunk';
_$('new_ATRNK_addUpdateButton').innerHTML = 'Add';
@@ -94,8 +107,13 @@
_$('new_ATRNK_DIV_title').innerHTML = 'Edit Analog Trunk';
_$('new_ATRNK_addUpdateButton').innerHTML = 'Update';
disable_usedChannels(EDIT_TRUNK);
- checkChannels( parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'] );
- zapchan_Before = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'];
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ checkChannels( parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['dahdichan'] );
+ dahdichan_Before = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['dahdichan'];
+ } else {
+ checkChannels( parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'] );
+ zapchan_Before = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'];
+ }
var ct = ASTGUI.contexts.TrunkDIDPrefix + EDIT_TRUNK ;
ASTGUI.updateFieldToValue( 'edit_trunkName' , parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK].getProperty('trunkname') );
getPreviousVolumeForChannelsofThisTrunk( EDIT_TRUNK );
@@ -151,7 +169,14 @@
return;
}
- if( zapchan_Before != scs ){
+ var before = "";
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ before = dahdichan_Before;
+ } else {
+ before = zapchan_Before;
+
+ }
+ if( before != scs ){
ASTGUI.cookies.setCookie( 'require_restart' , 'yes' );
}
@@ -167,7 +192,11 @@
window.location.reload();
};
- var tmp_object = {'zapchan':scs , trunkname: trunk_name } ;
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ var tmp_object = {'dahdichan':scs , trunkname: trunk_name } ;
+ } else {
+ var tmp_object = {'zapchan':scs , trunkname: trunk_name } ;
+ }
Electrical_Fields.each(function(fld){
tmp_object[fld] = ASTGUI.getFieldValue( _$(fld) );
});
@@ -178,7 +207,11 @@
// just update the selected channels
(function(){
var x = new listOfSynActions('users.conf');
- x.new_action('update', EDIT_TRUNK , 'zapchan', scs );
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ x.new_action('update', EDIT_TRUNK , 'dahdichan', scs );
+ } else {
+ x.new_action('update', EDIT_TRUNK , 'zapchan', scs );
+ }
x.new_action('delete', EDIT_TRUNK , 'gui_volume', '' );
x.new_action('delete', EDIT_TRUNK , 'gui_fxooffset', '' );
x.new_action('delete', EDIT_TRUNK , 'rxgain', '' );
@@ -207,7 +240,11 @@
var variablename = ASTGUI.globals.obcidUsrPrefix + EDIT_TRUNK ;
ASTGUI.updateaValue({ file: 'extensions.conf', context: 'globals', variable: variablename , value: ASTGUI.getFieldValue('trunk_obcid') }) ;
- parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'] = scs;
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['dahdichan'] = scs;
+ } else {
+ parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'] = scs;
+ }
ASTGUI.feedback({msg:'Updated Analog trunk ', showfor: 3 , color: '#5D7CBA', bgcolor: '#FFFFFF'}) ;
save_audioLevels( save_electrical );
};
@@ -245,7 +282,11 @@
var newRow = DOM_table_ATRUNKS_list.insertRow(-1);
newRow.className = ((DOM_table_ATRUNKS_list.rows.length)%2==1)?'odd':'even';
addCell( newRow , { html: parent.sessionData.pbxinfo['trunks']['analog'][item]['trunkname'] });
- addCell( newRow , { html: parent.sessionData.pbxinfo['trunks']['analog'][item]['zapchan'] } );
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ addCell( newRow , { html: parent.sessionData.pbxinfo['trunks']['analog'][item]['dahdichan'] } );
+ } else {
+ addCell( newRow , { html: parent.sessionData.pbxinfo['trunks']['analog'][item]['zapchan'] } );
+ }
addCell( newRow , { html: tmp} );
});
@@ -325,7 +366,11 @@
var getPreviousVolumeForChannelsofThisTrunk = function( trunk ){
var c = context2json({ filename:'users.conf' , context : trunk, usf:0 });
- var channels = ASTGUI.miscFunctions.chanStringToArray( parent.sessionData.pbxinfo.trunks.analog[trunk]['zapchan'] ) ;
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ var channels = ASTGUI.miscFunctions.chanStringToArray( parent.sessionData.pbxinfo.trunks.analog[trunk]['dahdichan'] ) ;
+ } else {
+ var channels = ASTGUI.miscFunctions.chanStringToArray( parent.sessionData.pbxinfo.trunks.analog[trunk]['zapchan'] ) ;
+ }
if ( !channels.length ) return ;
VOLSETTINGS = {} ;
@@ -403,7 +448,11 @@
var reset_calibration = function(){
- var zc = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'].split(',') ;
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ var zc = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['dahdichan'].split(',') ;
+ } else {
+ var zc = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'].split(',') ;
+ }
var x = new listOfActions('users.conf');
x.new_action('delete', EDIT_TRUNK , 'gui_volume', '' );
x.new_action('delete', EDIT_TRUNK , 'gui_fxooffset', '' );
@@ -443,7 +492,11 @@
ASTGUI.dialog.alertmsg('Finished Calibrating !! <BR> Click "Apply Changes" and restart your appliance ');
}
};
- var zc = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'] ;
+ if (parent.sessionData.PLATFORM.isAST_1_6) {
+ var zc = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['dahdichan'] ;
+ } else {
+ var zc = parent.sessionData.pbxinfo['trunks']['analog'][EDIT_TRUNK]['zapchan'] ;
+ }
var k = zc.split(',').join(' ') ;
parent.ASTGUI.dialog.waitWhile('Starting Calibration script ..');
var st = setTimeout(
More information about the asterisk-gui-commits
mailing list