List Info

Thread: pari: branch asterisknow r2344 - /branches/asterisknow/config/home.html




pari: branch asterisknow r2344 - /branches/asterisknow/config/home.html
user name
2008-02-19 11:07:21
Author: pari
Date: Tue Feb 19 11:07:21 2008
New Revision: 2344

URL: http://svn.digium.com/view/asterisk-gui?view=rev&am
p;rev=2344
Log:
update trunkdial macro if it is old



Modified:
    branches/asterisknow/config/home.html

Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches
/asterisknow/config/home.html?view=diff&rev=2344&r1=
2343&r2=2344
============================================================
==================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Tue Feb 19
11:07:21 2008
 -169,55
+169,64 
 function checkessentials(){
 	// see if asterisk_guitools exists in extensions.conf
 	//if everything ok set  asterisk_guitools_inextconf = 1;
-	var opt = { method: 'get', asynchronous: true, onComplete:
checkExtconfig };
-	opt.parameters="action=getconfig&filename=extensi
ons.conf" ;
-	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
-}
-
-
-function checkExtconfig(originalRequest){
-	var lines =
originalRequest.responseText.split("n");
-	for( var i=0 ; i < lines.length ; i++){
-		if ( lines[i].substr(0,9) == "Category-"  ){
-			var tmp = lines[i].split(": ");
-			if( tmp[1].match(asterisk_guitools) ){
-				parent.asterisk_guitools_inextconf = 1;
-				break;
-			}
+	var mtd = 'macro-trunkdial';
+	var updateTrunkDial = function(){
+		parent.ABOUT_TORELOAD_GUI = true;
+		var after = function(){ // then reload asterisk
+			parent.astmanEngine.cliCommand('dialplan reload',
function(t){ gui_feedback("Restarted Asterisk
!!",'blue'); 
+				top.window.location.reload(); // at this point ztscan
call was failed as it needs this context to run, so reload
+			}); 
+		};
+		var chs = new listOfActions(); 
+		chs.filename('extensions.conf'); var c = 0;
+		chs.build_action ( 'delcat', c , mtd, '', '');
+		chs.build_action ( 'newcat', c , mtd, '', '');
+		chs.build_action ( 'append', c , mtd, 'exten',
's,1,set(CALLERID(all)=${IF(${LEN(${CALLERID(num)})} > 6
? ${CALLERID(all)} : $)})' );
+		chs.build_action ( 'append', c , mtd, 'exten',
's,n,Dial($)' );
+		chs.build_action ( 'append', c , mtd, 'exten',
's,n,Goto(s-$,1)' );
+		chs.build_action ( 'append', c , mtd, 'exten',
's-NOANSWER,1,Hangup' );
+		chs.build_action ( 'append', c , mtd, 'exten',
's-BUSY,1,Hangup' );
+		chs.build_action ( 'append', c , mtd, 'exten',
'_s-.,1,NoOp' );
+		chs.callActions(after);
+	};
+	var installguitools = function(){
+		parent.ABOUT_TORELOAD_GUI = true;
+		var after = function(){ // then reload asterisk
+			parent.astmanEngine.cliCommand('dialplan reload',
function(t){ gui_feedback("Restarted Asterisk
!!",'blue'); 
+				top.window.location.reload(); // at this point ztscan
call was failed as it needs this context to run, so reload
+			}); 
+		};
+		var chs = new listOfActions(); 
+		chs.filename('extensions.conf'); var c = 0;
+		chs.build_action ( 'newcat', c , asterisk_guitools, '',
'');
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'executecommand,1,System($)' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'executecommand,n,Hangup()' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,1,Answer' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Playback(vm-intro)' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Record($)' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Playback(vm-saved)' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Playback(vm-goodbye)' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Hangup' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'play_file,1,Answer' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'play_file,n,Playback($)' );
+		chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'play_file,n,Hangup' );
+		chs.callActions(after);
+	};
+
+	var checkExtconfig = function (op){
+		if( !op.hasOwnProperty(mtd) || (op[mtd] &&
!op[mtd][0].beginsWith('exten=s,1,set')) ){
+			updateTrunkDial();
+			return;
 		}
-	}
-	
-	if(parent.asterisk_guitools_inextconf == 0 ){	// if no
context by name asterisk_guitools 
-		//parent.window.location.href =
"./setup/install.html";
-		installguitools();
-	}
-
-}
-
-
-function installguitools(){
-	parent.ABOUT_TORELOAD_GUI = true;
-	var after = function(){ // then reload asterisk
-		parent.astmanEngine.cliCommand('reload', function(t){
gui_feedback("Restarted Asterisk !!",'blue'); 
-			top.window.location.reload(); // at this point ztscan
call was failed as it needs this context to run, so reload
-		}); 
-	};
-	var chs = new listOfActions(); 
-	chs.filename('extensions.conf'); var c = 0;
-	chs.build_action ( 'newcat', c , asterisk_guitools, '',
'');
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'executecommand,1,System($)' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'executecommand,n,Hangup()' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,1,Answer' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Playback(vm-intro)' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Record($)' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Playback(vm-saved)' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Playback(vm-goodbye)' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'record_vmenu,n,Hangup' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'play_file,1,Answer' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'play_file,n,Playback($)' );
-	chs.build_action ( 'append', c , asterisk_guitools,
'exten', 'play_file,n,Hangup' );
-	chs.callActions(after);
-}
+		if( !op.hasOwnProperty(asterisk_guitools) ){	// if no
context by name asterisk_guitools 
+			installguitools();
+		}else{
+			parent.asterisk_guitools_inextconf = 1;
+		}
+	};
+	config2json('extensions.conf',0,checkExtconfig);
+}
+
 
 </script>
 <body id="foo" onload="localinit()"
topmargin=0  bgcolor="EFEFEF">


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--

asterisk-gui-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-g
ui-commits

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )