pari: branch 2.0 r3675 - /branches/2.0/config/followme.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Aug 18 12:54:41 CDT 2008


Author: pari
Date: Mon Aug 18 12:54:41 2008
New Revision: 3675

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

 Add a 'follow me macro' and update 'macro stdexten' such that a call to follwe me enabled users is sent to the 'follow me macro'

 This is still work in progress, the final version of the macro might look totally different.
 The idea is to use ASTDB eventually so that the user can enable/disable followme status using a feature code.

 The 'Follow me' panel will be exposed in the gui when all of this stuff works as expected.




Modified:
    branches/2.0/config/followme.html

Modified: branches/2.0/config/followme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/followme.html?view=diff&rev=3675&r1=3674&r2=3675
==============================================================================
--- branches/2.0/config/followme.html (original)
+++ branches/2.0/config/followme.html Mon Aug 18 12:54:41 2008
@@ -176,7 +176,6 @@
 	})();
 
 	$('#sqDestinations').click(function(event){
-
 		var s = ASTGUI.events.getTarget(event);
 		var cl =  $(s).attr("class") ;
 		if(!cl || !cl.beginsWith('step_') ){return;}
@@ -200,10 +199,11 @@
 			default:
 				break;
 		}
-
 		followMe_MiscFunctions.refresh_allDestinations();
-
 	});
+
+	followMe_MiscFunctions.updateExtensionsConf_Macro();
+
 };
 
 
@@ -326,7 +326,48 @@
 		CURRENT_DESTINATIONS.push(t);
 		this.refresh_allDestinations();
 		ASTGUI.resetTheseFields (['FMU_newNumber','FMU_newNumber_seconds' ]);
-	}
+	},
+
+	updateExtensionsConf_Macro : function(){ // followMe_MiscFunctions.updateExtensionsConf_Macro() ;
+		var after = function(){
+			window.location.reload();
+		};
+
+		var stdextn = 'macro-stdexten' ;
+		var ecnf = config2json({ filename:'extensions.conf', usf:0 });
+		if( ecnf.hasOwnProperty(stdextn) && !ecnf[stdextn][0].contains('FOLLOWME_') ){ // needs update
+			var x = new listOfActions('extensions.conf');
+			x.new_action( 'delcat', stdextn , '', '');
+			x.new_action( 'newcat', stdextn , '', '');
+			x.new_action( 'append', stdextn , 'exten', 's,1,GotoIf($[${FOLLOWME_${ARG1}}="1"]?4:2)');
+			x.new_action( 'append', stdextn , 'exten', 's,2,Dial(${ARG2},20)');
+			x.new_action( 'append', stdextn , 'exten', 's,3,Goto(s-${DIALSTATUS},1)');
+			x.new_action( 'append', stdextn , 'exten', 's,4,Macro(stdexten-followme,${ARG1})');
+			x.new_action( 'append', stdextn , 'exten', 's-NOANSWER,1,Voicemail(${ARG1},u)');
+			x.new_action( 'append', stdextn , 'exten', 's-NOANSWER,2,Goto(default,s,1)');
+			x.new_action( 'append', stdextn , 'exten', 's-BUSY,1,Voicemail(${ARG1},b)');
+			x.new_action( 'append', stdextn , 'exten', 's-BUSY,2,Goto(default,s,1)');
+			x.new_action( 'append', stdextn , 'exten', '_s-.,1,Goto(s-NOANSWER,1)');
+			x.new_action( 'append', stdextn , 'exten', 'a,1,VoicemailMain(${ARG1})');
+			x.callActions(after);
+			return;
+		}
+
+		var fmcat = 'macro-stdexten-followme' ;
+		if( !ecnf.hasOwnProperty(fmcat) ){ // add follow-me macro
+			var x = new listOfActions('extensions.conf');
+			x.new_action( 'newcat', fmcat , '', '');
+			x.new_action( 'append', fmcat , 'exten', 's,1,Followme(${ARG1})');
+			x.new_action( 'append', fmcat , 'exten', 's,2,Goto(s-${DIALSTATUS},1)');
+			x.new_action( 'append', fmcat , 'exten', 's-NOANSWER,1,Voicemail(${ARG1},u)');
+			x.new_action( 'append', fmcat , 'exten', 's-BUSY,1,Voicemail(${ARG1},b)');
+			x.new_action( 'append', fmcat , 'exten', 's-BUSY,2,Goto(default,s,1)');
+			x.new_action( 'append', fmcat , 'exten', '_s-.,1,Goto(s-NOANSWER,1)');
+			x.new_action( 'append', fmcat , 'exten', 'a,1,VoicemailMain(${ARG1})');
+			x.callActions(after);
+		}
+	}
+
 
 };
 




More information about the asterisk-gui-commits mailing list