pari: branch 2.0 r3883 - in /branches/2.0/config: ./ js/
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Wed Sep 24 18:52:15 CDT 2008
Author: pari
Date: Wed Sep 24 18:52:14 2008
New Revision: 3883
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3883
Log:
move the function to a more appropriate place
Modified:
branches/2.0/config/js/index.js
branches/2.0/config/js/pbx.js
branches/2.0/config/status.html
Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=3883&r1=3882&r2=3883
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Wed Sep 24 18:52:14 2008
@@ -445,6 +445,27 @@
var miscFunctions = {
+
+ listOfChannels: function() { // miscFunctions.listOfChannels() -- returns an array of current active channels
+ var raw_chan_status = makeSyncRequest ( { action :'status' } );
+ var to_return = [];
+ try {
+ var chunks = ASTGUI.miscFunctions.getChunksFromManagerOutput( raw_chan_status.trim().replace(/Event: StatusComplete/, "") ) ;
+ while( chunks.length ){
+ var this_chunk = ;
+ if( chunks[0].hasOwnProperty('Channel') ){
+ to_return.push(chunks[0]);
+ }
+ chunks.removeFirst();
+ }
+
+ } catch(e) {
+ ASTGUI.debugLog("Error listOfChannels: " + e);
+ return to_return;
+ }
+ return to_return;
+ },
+
getTimeIntervals: function(){ // miscFunctions.getTimeIntervals();
var TI_LIST = new ASTGUI.customObject;
var tmp_globals = context2json({ filename: 'extensions.conf' , context : 'globals' , usf:0 });
Modified: branches/2.0/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=3883&r1=3882&r2=3883
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Wed Sep 24 18:52:14 2008
@@ -603,26 +603,6 @@
//sessionData.pbxinfo.users = ASTGUI.toCustomObject(sessionData.pbxinfo.users);
// astgui_manageusers.listOfUsers();
return ( sessionData.pbxinfo.users && sessionData.pbxinfo.users.getOwnProperties && sessionData.pbxinfo.users.getOwnProperties() ) || [];
- },
-
- listOfChannels: function() { // returns an array of current active channels
- var raw_chan_status = makeSyncRequest ( { action :'status' } );
- var to_return = [];
- try {
- var chunks = ASTGUI.miscFunctions.getChunksFromManagerOutput( raw_chan_status.trim().replace(/Event: StatusComplete/, "") ) ;
- while( chunks.length ){
- var this_chunk = ;
- if( chunks[0].hasOwnProperty('Channel') ){
- to_return.push(chunks[0]);
- }
- chunks.removeFirst();
- }
-
- } catch(e) {
- ASTGUI.debugLog("Error listOfChannels: " + e);
- return to_return;
- }
- return to_return;
},
/* returns an array based on a manager packet/response */
Modified: branches/2.0/config/status.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/status.html?view=diff&rev=3883&r1=3882&r2=3883
==============================================================================
--- branches/2.0/config/status.html (original)
+++ branches/2.0/config/status.html Wed Sep 24 18:52:14 2008
@@ -148,7 +148,7 @@
var addCell = ASTGUI.domActions.tr_addCell;
/* XXX Move this function to ASTGUI */
- var ul = parent.astgui_manageusers.listOfChannels();
+ var ul = parent.miscFunctions.listOfChannels();
_$('thisPage_lite_Heading').innerHTML = "Active Channels - " + ul.length;
if(!ul.length){
More information about the asterisk-gui-commits
mailing list