pari: branch 2.0 r3773 - /branches/2.0/config/js/astman.js
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Fri Sep 5 16:52:26 CDT 2008
Author: pari
Date: Fri Sep 5 16:52:25 2008
New Revision: 3773
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3773
Log:
get DeviceStatus code for a given user extension
Modified:
branches/2.0/config/js/astman.js
Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=3773&r1=3772&r2=3773
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Fri Sep 5 16:52:25 2008
@@ -433,6 +433,18 @@
ASTGUI.debugLog("Executing manager command : '" + cmd + "'" , 'manager');
return makeSyncRequest ( { action :'command', command: cmd } );
},
+
+ getUser_DeviceStatus : function( usr ){ // ASTGUI.getUser_DeviceStatus(usr)
+ var t = makeSyncRequest({ action :'ExtensionState', Exten: usr }) ;
+ if( t.contains('Status: 0') ) return 'F' ; // No Device is Busy/InUse
+ if( t.contains('Status: 1') ) return 'B' ; // 1 or more devices InUse
+ if( t.contains('Status: 2') ) return 'B' ; // All Devices Busy
+ if( t.contains('Status: 4') ) return 'U' ; // All Devices Unavailable/Unregistered
+ if( t.contains('Status: 8') ) return 'R' ; // All Devices Ringing
+ if( t.contains('Status: 16') ) return 'H' ; // All Devices OnHold
+ return null;
+ },
+
mailboxCount : function(mbox){ // ASTGUI.mailboxCount(mox) ; --> returns the number of New/Old Messages in mbox's mailbox
if(!mbox.contains('@')){ mbox = mbox + '@default' ; }
More information about the asterisk-gui-commits
mailing list