pari: branch 2.0 r3676 - in /branches/2.0/config: ./ js/
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Mon Aug 18 15:24:58 CDT 2008
Author: pari
Date: Mon Aug 18 15:24:57 2008
New Revision: 3676
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3676
Log:
* Revised Follow Me Macros - thanks to bkruse for helping
* move the 'followme-macro/stdexten-macro updates' from followme.html to pbx.js
* expose Follow Me in the GUI
Modified:
branches/2.0/config/followme.html
branches/2.0/config/index.html
branches/2.0/config/js/pbx.js
Modified: branches/2.0/config/followme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/followme.html?view=diff&rev=3676&r1=3675&r2=3676
==============================================================================
--- branches/2.0/config/followme.html (original)
+++ branches/2.0/config/followme.html Mon Aug 18 15:24:57 2008
@@ -202,8 +202,6 @@
followMe_MiscFunctions.refresh_allDestinations();
});
- followMe_MiscFunctions.updateExtensionsConf_Macro();
-
};
@@ -326,49 +324,7 @@
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);
- }
- }
-
-
+ }
};
Modified: branches/2.0/config/index.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/index.html?view=diff&rev=3676&r1=3675&r2=3676
==============================================================================
--- branches/2.0/config/index.html (original)
+++ branches/2.0/config/index.html Mon Aug 18 15:24:57 2008
@@ -163,6 +163,10 @@
<div class="ui-accordion-link">Conferencing</div>
<div class="ui-accordion-desc">MeetMe conference bridging allows quick, ad-hoc conferences with or without security.</div>
</div>
+ <div page='followme.html'>
+ <div class="ui-accordion-link">Follow Me <sup><font color=#fffc31><b>beta</b></font></sup></div>
+ <div class="ui-accordion-desc"></div>
+ </div>
<div page='directory.html'>
<div class="ui-accordion-link">Directory</div>
<div class="ui-accordion-desc">Preferences for 'Dialing by Name Directory'</div>
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=3676&r1=3675&r2=3676
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Mon Aug 18 15:24:57 2008
@@ -161,6 +161,71 @@
return;
}
+ var stdextn = 'macro-stdexten' ;
+ if( !ecnf.hasOwnProperty(stdextn) || ( ecnf.hasOwnProperty(stdextn) && !ecnf[stdextn]['exten'].contains('FOLLOWME_') ) ){ // if stdexten does not forward to followme
+ sessionData.continueParsing = false;
+ (function(){
+ ASTGUI.dialog.waitWhile('Updating stdexten Macro in extensions.conf');
+ var after = function(){
+ setTimeout( function(){
+ var t = ASTGUI.cliCommand('dialplan reload') ;
+ if( parent.sessionData.DEBUG_MODE ){
+ alert('updated macro-stdexten in extensions.conf' + '\n' + 'Click OK to reload');
+ }
+ top.window.location.reload();
+ }, 1000);
+ }
+ 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},${ARG2})');
+ 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
+ sessionData.continueParsing = false;
+ (function(){
+ ASTGUI.dialog.waitWhile('Adding FollowMe Macro in extensions.conf');
+ var after = function(){
+ setTimeout( function(){
+ var t = ASTGUI.cliCommand('dialplan reload') ;
+ if( parent.sessionData.DEBUG_MODE ){
+ alert('Added FollowMe Macro to extensions.conf' + '\n' + 'Click OK to reload');
+ }
+ top.window.location.reload();
+ }, 1000);
+ }
+
+ var x = new listOfActions('extensions.conf');
+ x.new_action( 'newcat', fmcat , '', '');
+ x.new_action( 'append', fmcat , 'exten', 's,1,Dial(${ARG2},20)' );
+ x.new_action( 'append', fmcat , 'exten', 's,2,Followme(${ARG1},a)' );
+ x.new_action( 'append', fmcat , 'exten', 's,3,Voicemail(${ARG1},b)' );
+ 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);
+ })();
+ return;
+ }
+
+
+
+
(function(){
var tmp_file = ASTGUI.globals.zaptelIncludeFile;
var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=' + tmp_file , async: false }).responseText;
More information about the asterisk-gui-commits
mailing list