⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cfgbasic.html

📁 asterisk 的图形管理界面
💻 HTML
字号:
<!--
 * Asterisk-GUI	-	an Asterisk configuration interface
 *
 * Top level for configuration file
 *
 * Copyright (C) 2006-2007, Digium, Inc.
 *
 * Mark Spencer <markster@digium.com>
 * Pari Nannapaneni <pari@digium.com>
 *
 * See http://www.asterisk.org for more information about
 * the Asterisk project. Please do not directly contact
 * any of the maintainers of this project for assistance;
 * the project provides a web site, mailing lists and IRC
 * channels for your use.
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License Version 2. See the LICENSE file
 * at the top of the source tree.
 *
-->
<script>
var browser_alert = "You owe it to yourself to try it out !<BR><A href='http://www.getfirefox.com' style='font-size: 13px; font-family:arial,sans-serif,Helvetica,Trebuchet MS; color : #6C74A3;' target='_blank'>Get Firefox</A>";
</script>
<script src="scripts/prototype.js"></script>
<script src="scripts/rico.js"></script>
<script src="scripts/astman.js"></script>
<link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<script>
PanelDef = Class.create();
PanelDef.prototype = {
	initialize: function(name, label, icon, content) {
		this.name = name;
		this.label = label;
		this.icon = icon;
		this.content = content;
	}
}
var panels = new Array;
var eventeater = new Object;
var loggedon = -1;
var started = 0;
var accordion;
var copyright = "Copyright &copy;2006-2007 Digium, Inc.  All Rights Reserved. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
var tooltip_default = "Move the mouse over to a field to see tooltips";
var asterisk_guitools_inextconf = 0;

eventeater.eventcb = function(msgs) {
	if (loggedon == 1){
		astmanEngine.pollEvents();
	}
}


panels.push( 

	new PanelDef("home", "Home", "home.png",
		"Asterisk Configuration Panel - Please click on a panel to manage related features"),

	new PanelDef("users", "Users", "accordion-icon.gif",
		"Users is a short cut for quickly adding and removing all the necessary " +
		"configuration components for any new phone."),

	new PanelDef("meetme", "Conferencing", "accordion-icon.gif",
		"MeetMe conference bridging allow quick, ad-hoc conferences with or without " +
		"security."),

	new PanelDef("voicemail", "Voicemail", "accordion-icon.gif",
		"General settings for voicemail"),

	new PanelDef("queues", "Call Queues", "accordion-icon.gif",
		"Call queues allow calls to be sequenced to one or more agents."),

	new PanelDef("trunks", "Service Providers", "accordion-icon.gif",
		"Service Providers are outbound lines used to allow the system to make calls to the " +
		"real world.  Trunks can be VoIP lines or traditional telephony lines."),

	new PanelDef("numberplan", "Calling Rules", "accordion-icon.gif",
		"The Calling Rules define dialing permissions and least cost routing rules."),

	new PanelDef("incoming", "Incoming Calls", "accordion-icon.gif",
		"Define how your incoming calls should be handled & configure DID (Direct inward Dialing)"),

	new PanelDef("menus", "Voice Menus", "accordion-icon.gif",
		"Menus allow for more efficient routing of calls from incoming callers. Also known as IVR (Interactive Voice Response) menus or Digital Receptionist"),

	new PanelDef("record", "Record a Menu", "accordion-icon.gif",
		"Allows you to record custom voicemenus over a phone"),
	
	new PanelDef("status", "Active Channels", "accordion-icon.gif", "Monitor active channels."),

	new PanelDef("graphs", "Graphs", "accordion-icon.gif", "View Graphs of your System Information."),

	new PanelDef("sysinfo", "System Info", "accordion-icon.gif", "System Information."),

	new PanelDef("backup", "Backup", "accordion-icon.gif", "Backup Management."),

	new PanelDef("localexts", "Options", "accordion-icon.gif", "Admin Settings")

);

// show additional panels for advanced mode
if(window.location.href.match("advanced=yes") ){
panels.splice(10,0,

	new PanelDef("feditor", "File Editor", "accordion-icon.gif", " Manually edit Config Files"),

	new PanelDef("moh", "Music On Hold", "accordion-icon.gif", " Music on hold sometimes keeps people less angry while they wait for an answer"),

	new PanelDef("sip", "SIP", "accordion-icon.gif", "SIP (Session Initiation Protocol) Configuration"),

	new PanelDef("iax", "IAX", "accordion-icon.gif", "IAX (Inter-Asterisk eXchange Protocol) Configuration")

//	new PanelDef("jabber", "Jabber", "accordion-icon.gif", "Jabber users configuration"),

//	new PanelDef("jingle", "Jingle", "accordion-icon.gif", "Jingle configuration lets users connect to google talk networks"),

//	new PanelDef("zapata", "Zap Channel", "accordion-icon.gif", "Zapata telephony interface configuration")
	);
}


function setLoggedOn(onoff) {
	loggedon = onoff;
	for (var i = 0; i < panels.length; i++) {
		if (panels[i].name == 'home'){continue;}
		var w = _$(panels[i].name); 
		w.onClick = (loggedon == 1)?w.realonclick: false;
		w.onMouseOver = (loggedon == 1)?w.realonmouseover:false;
		w.style.visibility = (loggedon == 1)?'inherit':'hidden';
	}
}

function loadscreen(srcbody) {
	_$('mainscreen').style.display = '';
	if (loggedon == 1){ astmanEngine.pollEvents(); }
}

function setstatus(status) {	_$('status').innerHTML = copyright + status;	}
function showmainscreen(page) {
	if (started) {
		var opt = {
			method: 'get',
			asynchronous: true,
			onComplete: function (originalRequest){
				if ( originalRequest.responseText.match("Error") ) {
					window.location.href=window.location.href;
					return ;
				}
				if ( originalRequest.responseText.match("Pong") ) {
					_$('mainscreen').src = page.titleBar.id + ".html";
				}
			}
		};
		opt.parameters="action=ping" ;
		var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
		//$('mainscreen').src = page.titleBar.id + ".html";
	}
}

function fademainscreen(page, newpage) {
	// Confirm Discard Changes goes here 
	_$('tooltip').innerHTML = tooltip_default;
	_$('mainscreen').style.display = "none";
}

function show_Acctooltip(name, tip){
	if( loggedon != 1){ return; }
	_$('tooltip').innerHTML = tip ;

}

function registerajax() {
	Rico.Corner.round('tooltip_round', {compact:true});
		// if you want google style feedback boxes :-)
		// _$('feedback_round').style.backgroundColor = "#EFEFEF";		 
		// Rico.Corner.round('feedback_round', {compact:true}); 
		 
	if( navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Konqueror") != -1 || navigator.userAgent.indexOf("Safari") != -1 ){
		gui_feedback(browser_alert, 'green');
	}
	var pnameheight = 22;
	var pheight = (503  - (pnameheight*panels.length) ) ;
	accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
	//$('borderbox').style.height = $('screenholder').clientHeight;
	//$('titlebar').style.width = $('borderbox').clientWidth - 12;
	for (var i = 0; i < panels.length; i++) {
		var w = _$(panels[i].name) ;
		if (panels[i].name == 'home'){
			w.style.height =  "19px";
			continue;
		}
		w.realonclick = w.onClick;
		w.realonmouseover = w.onMouseOver;
	}
	started = 1;
}

astmanEngine.setURL(asterisk_rawmanPath );
astmanEngine.setEventCallback(eventeater.eventcb);

function Logoff() {
	if(!confirm("Are you sure ?")){ return true; }
	var opt2 = {
		method: 'get',
		asynchronous: true,
		onSuccess: function() {	 
			setLoggedOn(0);
			loggedon == -1;
			// reload the browser URL
			window.location.href=window.location.href;
		},
		onFailure: function(t) {
			gui_alert("Config Error: " + t.status + ": " + t.statusText);
		}
	};
	opt2.parameters ="action=logoff";
	var tmp2 = new Ajax.Request(asterisk_rawmanPath , opt2);
}

function system_link(){
	var newwindow_href = location.protocol + '//' + location.hostname + ':8003';
	window.open(newwindow_href ,'mainwindow','width=1024,height=768,resizable=yes, scrollbars=no, toolbar=no, location=no,status=yes, menubar=no')
}

function reloadConfig(){
	_$('reloadconfig').style.display = 'none'; 
	window.setTimeout( function(){ _$('reloadconfig').style.display=""; }, asterisk_guifbt );
	var opt = { 
		method: 'get', 
		asynchronous: true, 
		onSuccess: function(t) { gui_feedback("Restarted Asterisk !!",'blue'); } ,
		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
	};
	var uri = parent.build_action('renamecat', 0, "","", "", ""); 
	opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
}
</script>
<head>
	<title>Asterisk Configuration GUI (Beta)</title>
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body onload="registerajax( )" topmargin=1>
<table border="0" align="center" cellspacing="0" cellpadding="0" bgcolor="#dddddd" width=950 height=570>
<tr height=47>
	<td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
	<td valign='middle' align='center' bgcolor='white'>
		<div id="feedback_round" style="display:none;background-color: #FFFFFF; width:400px">
			<div id='feedback' style="font-family: Arial, sans-serif, Helvetica, Trebuchet MS ;font-size: 13px;font-weight : bold;"></div>
		</div>

	</td>
	<td valign='bottom' align='right' bgcolor='white'>
		<!-- <a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp; -->
		<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
		<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
		<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
		<input type="hidden" id="login_name">
	</td>
</tr>
<tr><td height="505">
	<div id="configpanel" style="width:150px; height: 505px;">
	<script>
	for (var i = 0; i < panels.length; i++) {
		var t = "<div onmouseover='show_Acctooltip(\""+ panels[i].name +"\", \""+ panels[i].content +"\")'  onmouseout='show_Acctooltip(\""+ panels[i].name +"\", \"" + tooltip_default +"\")'>";
		t += "	<div id='" + panels[i].name + "' class='accordionTabTitleBar'>";
		t += "		<nobr><img style='vertical-align:middle' src='images/" + panels[i].icon + "'>";
		t += "		<span style='margin-left: 0px;font-weight:bold'>" + panels[i].label + "</span></nobr>";
		t += "  </div>";
		t += "  <div class='accordionTabContentBox' style='background-image:url(images/panel.png)'>" +  panels[i].content + "</div>";
		t += "</div>";
		document.write(t);
	}
	</script>
	</div>
	</td>
	<td width="550" height="505" bgcolor="#EFEFEF" valign="top" id="screenholder">
		<div id="titlebar" class="mainscreenTitleBar" style="position:absolute;top:48px">
			<span style="margin-left: 4px;font-weight:bold">Loading Screen&nbsp;<img src='images/dots.gif'></span>
		</div>
		<div id="borderbox" class="mainscreenBorderBox" height="100%"></div>
		<iframe width="540" height="505" frameborder="0" border="0" marginheight="0" marginwidth="0" src="home.html" id="mainscreen" style="position:absolute;top:48px;" SCROLLING=no></iframe>
	</td>
	<td valign=top width=250 height="505">
		<div class="mainscreenTooltipBar" align=right>
		<span id="reloadconfig" style="display:none"></span>&nbsp;&nbsp;&nbsp;<span id="logoutlink" style="display:none"></span>&nbsp;
		</div>
		<div id="tooltip_round" class="tooltip_round">
		<div id='tooltip' style="margin-left:4px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; "><script>document.write(tooltip_default);</script></div>
		</div>
	</td>
</tr>
<tr><td colspan="3" align=center height=18>
		<div id="status" class="statusbar">Copyright &copy;2006-2007 Digium, Inc.  Digium&reg; and Asterisk&reg; are registered <a href="http://www.digium.com/en/company/profile/trademarkpolicy.php">trademarks</a> of Digium, Inc.  All Rights Reserved. <i><a href="#">Legal Information</a></i></div>
		</td>
</tr>
</table>
</body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -