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

📄 menus.html.svn-base

📁 asterisk-gui asterisk网关接口编程 控制asterisk的接口
💻 SVN-BASE
📖 第 1 页 / 共 4 页
字号:
<!-- * Configuration for IVR (Interactive Voice Menus) * * Copyright (C) 2006 - 2007, Digium, Inc. * * Mark Spencer <markster@digium.com> * Pari Nannapaneni <pari@digium.com> * * All Rights Reserved. * * Distribution of this file is subject to the license * agreement you accepted when obtained and/or activated * the Digium product containing this file. *--><script src="scripts/prototype.js"></script><script src="scripts/astman.js"></script><script src="scripts/tooltip.js"></script><link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" /><style type="text/css">	.page_header {		font-size : 12px;		padding : 4px 6px 4px 6px;		border-style : solid none solid none;		border-top-color : #BDC7E7;		border-bottom-color : #182052;		border-width : 1px 0px 1px 0px;		background-color : #ef8700;		margin-bottom: 10px;		color : #ffffff;	}	.VoiceMenuMainTable{		border : 0;		width	: 750px; 		font-size: 11px;	}</style><script>var widgets = {};var adstatus;var menuscallbacks = new Object;var extencallbacks = new Object;var usercallbacks = new Object;var numcallbacks = new Object;var fieldnames = new Array('delete', 'new','save','cancel');var voicemenusdata = new Object;var current_context;var keys = new Array('0','1','2','3','4','5','6','7','8','9','*','#','t','i');var extensions_array = new Array;var answer_call_string = "s,1,Answer";var localextenlength ;var LISTOFSOUNDS = [];function format_step(this_step){	var temp = this_step.split(',');	if( temp[2].match("Goto") && this_step.match(TIMERULES_CATEGORY)  ){		var tmp = this_step.split('Goto')[1].substr(1);		tmp = tmp.substr(0, tmp.length-1);		var m = _$('tbr');		for(var l=0; l < m.options.length; l++ ){			if(m.options[l].value == tmp){ return "Goto TimeBasedRule '"+  m.options[l].text + "'"; }		}		return "Goto '"+  tmp + "' (NOT FOUND)";	}	if( temp[2].match("Goto") && this_step.match('ringroups-custom-')  ){		var tmp = this_step.split('Goto')[1].substr(1);		tmp = tmp.substr(0, tmp.length-1);		var m = _$('rgrp');		for(var l=0; l < m.options.length; l++ ){			if(m.options[l].value == tmp){ return "Goto RingGroup '"+  m.options[l].text + "'"; }		}		return "Goto '"+  tmp + "' (NOT FOUND)";	}	if( temp[2].match("Answer") )		return "Answer the Call";	if( temp[2].match("Authenticate") ){		// Background('') - whatever in the brackets		temp[2] = temp[2].replace(/Authenticate\(/, "");		temp[2] = temp[2].replace(/\)/, "");		return "Authenticate for Password '" + temp[2] + "'";	}	if( temp[2].match("DISA") ){		// Background('') - whatever in the brackets		temp[2] = temp[2].replace(/DISA\(/, "");		temp[2] = temp[2].replace(/\)/, "");		return "DISA ***********";	}	if( temp[2].match("Background") ){		// Background('') - whatever in the brackets		temp[2] = temp[2].replace(/Background\(/, "");		temp[2] = temp[2].replace(/\)/, "");		return "Play '" + temp[2] + "' & Listen for KeyPress";	}	if( temp[2].match("TIMEOUT") && temp[2].match("digit") ){		temp[2] = temp[2].replace(/Set\(TIMEOUT\(digit\)\=/, "");		temp[2] = temp[2].replace(/\)/, "");		return "Wait '"+ temp[2] +"' sec for KeyPress";	}	if( temp[2].match("TIMEOUT") && temp[2].match("response") ){		temp[2] = temp[2].replace(/Set\(TIMEOUT\(response\)\=/, "");		temp[2] = temp[2].replace(/\)/, "");		return "Response Timeout to '" + temp[2] + "' sec";	}	if( temp[2].match("Playback") ){		temp[2] = temp[2].replace(/Playback\(/, "");		temp[2] = temp[2].replace(/\)/, "");		return "Play '" + temp[2] + "' & Donot Listen for KeyPress";	}	if( temp[2].match("WaitExten") ){		temp[2] = temp[2].replace(/WaitExten\(/, "");		temp[2] = temp[2].replace(/\)/, "");		return "WaitExten '"+ temp[2] + "' sec";	}else if( temp[2].match("Wait") ){		temp[2] = temp[2].replace(/Wait\(/, "");		temp[2] = temp[2].replace(/\)/, "");		return "Wait '"+ temp[2] + "' sec";	}	if( temp[2].match("Goto") && temp[2].match("voicemenu-")  ){		var tmp = temp[2].split('(');		var tmp1 = tmp[1].split('|');		try{			return "Goto Menu '"+  voicemenusdata[tmp1[0]].comment  + "'";		}		catch(e){			return "Goto Menu '"+  tmp1[0] + "'";		}	}	if( temp[2].match("Goto") && !temp[2].match("voicemenu-")  ){		var tmp = temp[2].split('(');		var tmp1 = tmp[1].split('|');		if( tmp1[1] == 'o' ){return "Goto 'Operator'";}		return "Goto Exten '"+ tmp1[1] + "'";	}	if( temp[2].match("VoiceMailMain") && temp[2].match("CALLERID")  ){		return "Check VoiceMail for own Extension";	}		if( temp[2].match("Hangup") )		return "Hangup";	if( temp[2].match("Busy") )		return "Busy Tone";	if( temp[2].match("Congestion") )		return "Congestion";	if( temp[2].match("Directory") && temp[2].match("default"))		return "Goto Directory"; return this_step;}function load_extensions(my_field_options){	var _mo = _$(my_field_options); 	_mo.options.length=0;	for(var x=0; x < extensions_array.length; x++){		var newoption = document.createElement("option"); 		newoption.text = extensions_array[x] ; 		newoption.value = extensions_array[x] ;		if(extensions_array[x] == 'o'){ newoption.text = "Operator" ; }		_mo.options.add(newoption);	}}function load_menus(my_field_options){	var _mo = _$(my_field_options) ;	var _vms = _$('vmenus') ;	_mo.options.length=0;		for(var x=0; x < _vms.length; x++){		if( _vms.options[x].text == "New Entry" ){ continue ; }		var newoption = document.createElement("option"); 		newoption.text = voicemenusdata[ _vms.options[x].value].comment ; 		newoption.value = _vms.options[x].value ;		_mo.options.add(newoption);	}}function select_menu (my_field_options, menustring, a){	var tmp = menustring.split('(');	var tmp1 = tmp[1].split('|');	var _mfo = _$(my_field_options) ;	if(a == "ismenu"){		var check_against = tmp1[0]; 	}else if(a == "isext"){ 		var check_against = tmp1[1] ;	}	for(var y=0; y < _mfo.options.length; y++ ){		if( _mfo.options[y].value == check_against ){			_mfo.options[y].selected = true;			return true;		}	}	// if not in the current list of voicemenus/extensions then add it to the menu	var newoption = document.createElement("option"); 	newoption.text = check_against ; 	newoption.value = check_against ;	_mfo.options.add(newoption);	_mfo.options[y].style.fontWeight = 'bold';	_mfo.options[y].selected = true;	_mfo.style.color = '#CC0000';}function add_newvmenu_tolistofkeymenus(){	var _vms = _$('vmenus') ;	var _vmsv = _vms.options[_vms.selectedIndex].value ;	var _cv = _$('comment').value ;	for (var k=0; k< keys.length; k++){		var current_key_menus='keypress_'+ keys[k] + '_menus';		var newoption = document.createElement("option"); 		newoption.text = _cv ; 		newoption.value = _vmsv ;		_$(current_key_menus).options.add(newoption);	}	// and also add it to $('add_newstep_menus')	var newoption = document.createElement("option"); 	newoption.text = _cv ; 	newoption.value = _vmsv ;	_$('add_newstep_menus').options.add(newoption);}function delete_vmenu_fromlistofmenus(){	var _cv = _$('comment').value ;	for (var k=0; k< keys.length; k++){		var current_key_menus='keypress_'+ keys[k] + '_menus';		var _ckm = _$(current_key_menus);		for(var i=0; i< _ckm.options.length; i++){			if( _ckm.options[i].text == _cv ){				// delete this option from the $(current_key_menus)				var deleted_voicmenu = _ckm.options[i].value ;				_ckm.remove(i);				break;			}		}	}	var _anm = _$('add_newstep_menus') ;	for(var i=0; i< _anm.options.length; i++){		if( _anm.options[i].text == _cv ){			_anm.remove(i);			break;		}	}	// use the deleted_voicmenu to delete the alias (if it exists) in the default	if(_$('alias_exten').value.length > 0){		var existing_alias_string = voicemenusdata[deleted_voicmenu].alias_exten + ",1,Goto(" + deleted_voicmenu + "|s|1)"  ;		var uri = build_action('delete', 0, specialcontext ,"exten", "", existing_alias_string ); 		makerequest('u','extensions.conf', uri, function(t){ } );	}	delete voicemenusdata[deleted_voicmenu];}function change_vmenuname_inlistofmenus(oldname,newname){	for (var k=0; k< keys.length; k++){		var current_key_menus='keypress_'+ keys[k] + '_menus';		var _ckm = _$(current_key_menus) ;		for(var i=0; i< _ckm.options.length; i++){			if( _ckm.options[i].text == oldname ){				_ckm.options[i].text = newname;				break;			}		}	}}function  key_action(a, field){	enable_savecancel();	_mft = _$('keypress_'+ field + '_text' );	_mfe = _$('keypress_'+ field + '_exts').style;	_mfm = _$('keypress_'+ field + '_menus').style	_mft.style.display = "none";	_mfe.display = "none";	_mfm.display = "none";	if(a=='gotomenu'){ //show menus dropdown		_mfm.display = "";	}else if(a=='gotoextension'){ //show extensions dropdown		_mfe.display = "";	}else if(a=='Custom'){ //show a  text box		_mft.style.display = "";		_mft.focus();	}else if(a=='disabled' || a=='Hangup' || a=='PlayInvalid'){	//show nothing	}}function sortNumber(a,b){	return a - b ;}function add_newstep(){	var _vmv = _$('vmenus').value ;	var _nsa = _$('newstep_action');	var _nsv = _$('newstep_var') ;	var _nss = _$('newstep_sounds');	if( !_nsa.value ){		gui_alert("Please select an action for this step");		_nsa.focus();		return;	}	if( _nsa.value== "Background"  || _nsa.value== "Playback" ){		_nsv.value = _nss.value;	}	if( _nsa.value != "Answer" && _nsa.value != "GotoDirecotry" && _nsa.value !="CheckOwnVoiceMail" && _nsa.value != "Busy" && _nsa.value != "Hangup" && _nsa.value != "Congestion" && !_nsv .value ){				if( _nsa.value.toLowerCase() == "dialringgroup" ){			if(!_$('rgrp').options.length ){				gui_alert("No Ring Groups exist. <BR> Please create a Ring Group before selecting this option.");			}else{				gui_alert("Please select a RingGroup");			}			return;		}		gui_alert("Please enter a value for '" + _nsa.value +"'");		_nsv.focus();		return;	}	_$('status_message').style.display = "";	// prepare a request to add the new step to the voicemenu	// make a request to append	var uri = "";	var action_string = "";	var priorities = new Array;

⌨️ 快捷键说明

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