pari: branch 2.0 r4019 - in /branches/2.0/config/js: astman.js index.js pbx.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Oct 28 15:06:54 CDT 2008


Author: pari
Date: Tue Oct 28 15:06:53 2008
New Revision: 4019

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4019
Log:

 AA50-2035 - Paging & Intercom (Work in Progress)



Modified:
    branches/2.0/config/js/astman.js
    branches/2.0/config/js/index.js
    branches/2.0/config/js/pbx.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=4019&r1=4018&r2=4019
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Tue Oct 28 15:06:53 2008
@@ -332,6 +332,8 @@
 		TrunkDefaultSuffix : '_default', // ASTGUI.contexts.TrunkDefaultSuffix - to create 'DID_trunk_default' that will be included in [DID_trunk]
 		RingGroupPrefix: 'ringroups-custom-', // ASTGUI.contexts.RingGroupPrefix 
 		RingGroupExtensions: 'ringgroups', // ASTGUI.contexts.RingGroupExtensions
+		PageAnExtension :'page_an_extension', // ASTGUI.contexts.PageAnExtension
+		PageGroups : 'pagegroups', // ASTGUI.contexts.PageGroups
 		TimeBasedRulePrefix: 'timebasedrule-custom-', // ASTGUI.contexts.TimeBasedRulePrefix 
 		TimeIntervalPrefix: 'timeinterval_', // ASTGUI.contexts.TimeIntervalPrefix
 		VoiceMenuPrefix: 'voicemenu-custom-', // ASTGUI.contexts.VoiceMenuPrefix

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=4019&r1=4018&r2=4019
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Tue Oct 28 15:06:53 2008
@@ -822,11 +822,19 @@
 				f.optionValue = (fortbr)? rg + '|s|1' : 'Goto('+ rg +'|s|1)';
 				tmp.push(f);
 			});
+		var y = astgui_managePageGroups.getPGsList();
+			y.each(function(pge){
+				var f = new destination;
+				f.optionText = 'Page Group -- ' + pge ;
+				f.optionValue = 'Goto('+ ASTGUI.contexts.PageGroups +'|'+ pge +'|1)';
+				tmp.push(f);
+			});
+
 		var y = sessionData.pbxinfo.vmgroups.getOwnProperties();
 			y.each(function( this_vmg_exten ){
 				var f = new destination;
 				f.optionText = 'VoiceMail Group -- ' + (sessionData.pbxinfo.vmgroups[this_vmg_exten].getProperty('label') || this_vmg_exten ) ;
-				f.optionValue = (fortbr) ? ASTGUI.contexts.VoiceMailGroups +'|' + this_vmg_exten + '|1' : 'Goto('+ ASTGUI.contexts.VoiceMailGroups +'|' + this_vmg_exten + '|1)'; ;
+				f.optionValue = (fortbr) ? ASTGUI.contexts.VoiceMailGroups +'|' + this_vmg_exten + '|1' : 'Goto('+ ASTGUI.contexts.VoiceMailGroups +'|' + this_vmg_exten + '|1)' ;
 				tmp.push(f);
 			});
 
@@ -877,7 +885,7 @@
 					tmp.push( tmp_thisRg.extension );
 				}
 			} );
-
+		tmp = tmp.concat( astgui_managePageGroups.getPGsList() );
 		var tmp_LE = ASTGUI.cloneObject(sessionData.pbxinfo['localextensions']);
 		if( tmp_LE.getProperty('defaultDirectory') ){
 			tmp.push( tmp_LE.getProperty('defaultDirectory') );

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=4019&r1=4018&r2=4019
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Tue Oct 28 15:06:53 2008
@@ -29,7 +29,7 @@
 		// check whether the config files are in proper format and have every thing needed for the gui to function properly
 				var check_For_Contexts = {
 					general : { static : 'yes', writeprotect : 'no', clearglobalvars : 'yes' },
-					globals : { FEATURES : '' , DIALOPTIONS : '' , RINGTIME: '20', FOLLOWMEOPTIONS : '' },
+					globals : { FEATURES : '' , DIALOPTIONS : '' , RINGTIME: '20', FOLLOWMEOPTIONS : '', PAGING_HEADER : 'Intercom', PAGING_TIMEOUT : '60' },
 					'default' : {},
 					'macro-stdexten' : [
 						'exten=s,1,Set(__DYNAMIC_FEATURES=${FEATURES})',
@@ -53,6 +53,12 @@
 						'exten=s-BUSY,2,Goto(default,s,1)',
 						'exten=_s-.,1,Goto(s-NOANSWER,1)',
 						'exten=a,1,VoicemailMain(${ARG1})'
+					],
+					'macro-pagingintercom' : [
+						'exten=s,1,SIPAddHeader(Alert-Info: ${PAGING_HEADER})',
+						'exten=s,2,Set(TIMEOUT(absolute)=${PAGING_TIMEOUT})',
+						'exten=s,3,Page(Local/${ARG1}|${ARG2})',
+						'exten=s,4,Hangup'
 					]
 				};
 		
@@ -62,6 +68,8 @@
 				check_For_Contexts[ASTGUI.contexts.VoiceMenuExtensions] = {} ;
 				check_For_Contexts[ASTGUI.contexts.VoiceMailGroups] = {} ;
 				check_For_Contexts[ASTGUI.contexts.Directory] = {} ;
+				check_For_Contexts[ASTGUI.contexts.PageAnExtension] = {} ;
+				check_For_Contexts[ASTGUI.contexts.PageGroups] = {} ;
 				check_For_Contexts[ASTGUI.contexts.guitools] = [
 					'exten=executecommand,1,System(${command})',
 					'exten=executecommand,n,Hangup()',
@@ -246,6 +254,7 @@
 		sessionData.pbxinfo['GLOBALS'] = new ASTGUI.customObject; // store extensions.conf --> [globals]
 		sessionData.pbxinfo['ringgroups'] = new ASTGUI.customObject;
 		sessionData.pbxinfo['timebasedRules'] = new ASTGUI.customObject;
+		sessionData.pbxinfo['pagegroups'] = [];
 
 		for(var d in c){ if(c.hasOwnProperty(d)) {
 			// note: remember c[d] is an Array and is not an Object (we used usf:0)
@@ -264,6 +273,9 @@
 			}
 			if ( d == ASTGUI.contexts.VoiceMailGroups ){
 				astgui_manageVMgroups.parseContext(c[d]);
+			}
+			if ( d == ASTGUI.contexts.PageGroups ){
+				sessionData.pbxinfo['pagegroups'] = c[d] ;
 			}
 			if( d == 'globals' ){ // look for outboundcid of all users and globaloutboungcid
 				astgui_parseGlobalContext( c[d] );
@@ -1709,6 +1721,33 @@
 	}
 };
 
+astgui_managePageGroups = {
+	getPGsList : function(){ // astgui_managePageGroups.getPGsList();
+ 		var tmp_pgContext = sessionData.pbxinfo['pagegroups'] ;
+		var tmp_pgExtens = [];
+		tmp_pgContext.each(function(this_line){
+			var t = ASTGUI.parseContextLine.getExten(this_line);
+			if(t){ tmp_pgExtens.push(t); }
+		});
+		return tmp_pgExtens;
+	},
+	updatePGsCache : function(cbf){
+		setTimeout(function(){
+			sessionData.pbxinfo['pagegroups'] = context2json({filename:'extensions.conf', context: ASTGUI.contexts.PageGroups , usf:0});
+			cbf();
+		}, 1000);
+	},
+	addPageGroup : function(new_pg_line, cb){ // astgui_managePageGroups.addPageGroup( new_pg_line, cbf );
+		var x = new listOfSynActions('extensions.conf');
+		x.new_action('append', ASTGUI.contexts.PageGroups , 'exten', new_pg_line);
+		x.callActions();
+		this.updatePGsCache(cb);
+	},
+	deletePageGroup : function( pgexten , cb ){ // astgui_managePageGroups.deletePageGroup( pgexten, cbf );
+		var AF = this.updatePGsCache ;
+		ASTGUI.miscFunctions.delete_LinesLike({ context_name : ASTGUI.contexts.PageGroups , beginsWithArr: [ 'exten=' + pgexten + ',' ] , filename: 'extensions.conf', hasThisString:'Macro(', cb:function(){AF(cb);}});
+	}
+};
 
 astgui_manageVMgroups = {
 	/*




More information about the asterisk-gui-commits mailing list