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

📄 menus.html.svn-base

📁 asterisk-gui asterisk网关接口编程 控制asterisk的接口
💻 SVN-BASE
📖 第 1 页 / 共 4 页
字号:
	_alias_exten.disabled = false;	_alias_exten.value = "";	_comment.disabled = false;	_comment.value = "";	_comment.focus();}function localajaxinit() {	parent._$('mainscreen').width= 798;	ASTGUI.events.add(document, 'mouseover', show_tooltip);	showdiv_statusmessage();	setWindowTitle("Voice Menus");	_$('message_text').innerHTML ="Saving Changes...";	for (x =0 ; x<fieldnames.length; x++){		widgets[fieldnames[x]] = _$(fieldnames[x]);		widgets[fieldnames[x]].disabled = true;	}	//parent.loadscreen(this);	parent.astmanEngine.config2list("extensions.conf", _$('extensions'), new Array(), extencallbacks);}//extencallbacksextencallbacks.format = function(t, x) {	var res;	var qname;	if(t.name == TIMERULES_CATEGORY && t.fields[x].match("NoOp") ){		return null ; // disable time based rules		var m = t.fields[x].split('NoOp')[1].substr(1);		m = m.substr(0, m.length-1);				var l = document.createElement('option');			l.text = m ;			l.value = TIMERULES_CATEGORY + ","+ t.fields[x].split(',')[0] + ",1" ;				if(document.attachEvent){ 			//_$('tbr').add(l);		}else{			//_$('tbr').add(l,null);		}		return null ;	}		if( t.name.match('ringroups-custom-') && !x ){		var k = t.fieldbyname['gui_ring_groupname'];		var l = document.createElement('option');			l.text = (k)?k:t.name;			l.value = t.name + ",s,1" ;				if(document.attachEvent){ 			_$('rgrp').add(l);		}else{			_$('rgrp').add(l,null);		}		return null;	}	if ((t.name != specialcontext))	return null;	// check whether the extension is an alias to a custom voice menu	try{		var temp = t.fields[x].split(',') ;		if ( temp[2].match("Goto") && temp[2].match("voicemenu-custom-" )  ){ return null ; }	}	catch(e){	}	res = format_extension(_$('extensions'), t, x);	return res;}extencallbacks.loaded = function() {	parent.astmanEngine.run_tool(asterisk_guiListFiles + " " + asterisk_Sounds_path, callback = function() { 	var opt = { method: 'get', asynchronous: true,		onComplete: function(originalRequest){			var sndfiles = originalRequest.responseText.split("\n") ;			var file_name;			var listof_DefaultSounds = {};			for( var i =0 ; i < sndfiles.length ; i++){				if( typeof sndfiles[i] == "undefined"  || sndfiles[i] == "" ){					continue;				}				sndfiles[i] = sndfiles[i].replace(/^\s*|\s*$/g,'') ;				if( sndfiles[i] == "" ){ continue; }				file_name = sndfiles[i].stripTags() ;				file_name = file_name.replace(/\..*/,""); /* Replace .ulaw .gsm .whatever with nothing so its just the sound file */				listof_DefaultSounds[file_name] = true;			}			for(var i in listof_DefaultSounds){				if( listof_DefaultSounds.hasOwnProperty(i) ){ 					LISTOFSOUNDS.push(i);				}			}			load_recordedfiles();		},		onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }	};	opt.parameters="";	var tmp = new Ajax.Request(asterisk_guiSysInfo_output , opt);	});}function load_recordedfiles(){	parent.astmanEngine.run_tool(asterisk_guiListFiles + " " + asterisk_menusRecord_path, callback = function() { 	var opt = { method: 'get', asynchronous: true,		onComplete: function(originalRequest){			// Add Recorded Voiemenus to the list of sound files			var recfiles = originalRequest.responseText.split("\n") ;			var file_name;			for( var i =0 ; i < recfiles.length ; i++){				if( typeof recfiles[i] == "undefined"  || recfiles[i] == "" ){					continue;				}				recfiles[i] = recfiles[i].replace(/^\s*|\s*$/g,'') ;				if( recfiles[i] == "" ){ continue; }				file_name = recfiles[i].stripTags() ;				file_name = file_name.substr(0,(file_name.length - 4) ) ;				LISTOFSOUNDS.push("record/" + file_name);			}			ASTGUI.COMBOBOX.call(  _$('newstep_sounds') , LISTOFSOUNDS, 400 );			parent.astmanEngine.config2list("users.conf", _$('users'), new Array(), usercallbacks);		},		onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }	};	opt.parameters="";	var tmp = new Ajax.Request(asterisk_guiSysInfo_output , opt);	});}extencallbacks.eachline = true;// user callbacksusercallbacks.format = function (t,x){	if ((t.name == 'general')){		if (t.fieldbyname['localextenlength'] && t.fieldbyname['localextenlength'].length){			localextenlength =  t.fieldbyname['localextenlength'] ;		}else{			localextenlength =  4 ;		}		return null;	}	//if (t.name.substring(0,6) == 'trunk_')	//	return null;	if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {		return null;	}else{		return t.name;	}}usercallbacks.identifier = "extension";usercallbacks.loaded = function (){	var _exts = _$('extensions') ;	var _users = _$('users') ;	for(var p=0; p < _exts.length; p++){		var tmp = _exts.options[p].text.split (" -- ");		extensions_array.push (tmp[0]);	}	for(var p=0; p < _users.length; p++){		extensions_array.push (_users.options[p].text);	}	extensions_array = extensions_array.sort(); // or extensions_array.sort(sortNumber);	parent.astmanEngine.config2list("extensions.conf", _$('vmenus'), widgets, menuscallbacks);}function free_mem(){	parent._$('mainscreen').width= 540;	if( navigator.userAgent.indexOf("MSIE") == -1 ){ return true; }	try{		widgets['save'].hostselectbox = null ;		widgets['cancel'].hostselectbox = null ;		widgets['new'].hostselectbox = null ;		widgets['delete'].hostselectbox = null ;		purge( document.body );	} catch(e){ }}function show_addStep(){	_$('bg_transparent').style.display="" ;	_$('NewStep_Content').style.display="" ;}function hide_addStep(){	_$('bg_transparent').style.display="none" ;	_$('NewStep_Content').style.display="none" ;}</script><body id="foo" onload="localajaxinit()"  bgcolor="EFEFEF" onunload="free_mem()"><div class="page_header">	<span style="margin-left: 4px;font-weight:bold;">Voice Menus Configuration</span>	<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span></div><div class="mainscreenContentBox" id="userscontent"><table class="VoiceMenuMainTable" align="left">	<tr valign="top">		<td colspan='2'> Voice Menus: </td>	</tr>	<tr valign="top">		<td>	<select size="25" id="vmenus" style="width:180px;" class="input10"><option>Loading...</option></select>	</td>		<td valign=top align="right" width=560 height=415>			<select id='extensions' style='display:none;width:0px;height:0px'></select><select id='users' style='display:none;width:0px;height:0px'></select><select id='recorded_files' style='display:none;width:0px;height:0px'></select>			<table align="center" width="560">			<tr>				<td width="50" align=left class="field_text" tip="en,menus,0">Name:</td>				<td align=left class="field_text">					<input id='comment'  size=15 onKeyUp="enable_savecancel()"  pattern='^[a-zA-Z_0-9 ]*$' disabled  class="input8">&nbsp;					<span tip="en,menus,5">					Extension: <input id="alias_exten"  onKeyUp="enable_savecancel()"  size=4 disabled class="input8" tip="en,menus,5">					</span>					&nbsp;&nbsp;&nbsp;&nbsp;					<label FOR="allowexten"  tip="en,menus,3">					<input type=checkbox id=allowexten disabled onclick="enable_savecancel()"> Allow Dialing other Extensions?					</label>				</td>			</tr>			<tr>	<td class="field_text"  tip="en,menus,1">Steps:<BR>					<input  style='width:45'  type="button" id="stepUp" value="Up" disabled onClick="step_up()" class="buttonbold"><BR><BR>					<input  style='width:45' type="button" id="stepDown" value="Down" disabled onClick="step_down()" class="buttonbold">				</td>				<td><select id='steps' size=8  style="width:550px;" onClick="step_onselect()" disabled class="input8"></select></td>			</tr>			<tr>	<td> </td>				<td class="field_text">				<input type=button style='width:105' id='b_ShowAddStep' onclick="show_addStep()"  value="Add new Step" disabled  class="buttonbold">				&nbsp;<input type=button style='width:140' id='deletestep' onclick="delete_step()"  value="Delete selected Step" disabled  class="buttonbold">				</td>			</tr>			<tr>	<td colspan=2 height=25></td></tr>			<tr><td colspan=2>				<div>					<table cellpadding=3 cellspacing=0 width="100%">					<TR bgcolor='#B8B8B8'>						<TD width=35 class="field_text">Key</TD><TD class="field_text">Action</TD>						<TD width=440 class="field_text" tip="en,menus,4" align=center><B>'Keypress' Events</B></TD>					</TR>					</table>				</div>				<div id="keypressoptions" style="height:190px;overflow :auto;display :none;">					<table cellpadding=3 cellspacing=0 width="100%">					<script>					for (var k=0; k< keys.length; k++){						var p =  generate_fields( keys[k] )  ; 						switch(keys[k]){							case 't': var omo =  " tip=\"en,menus,6\" " ; break;							case 'i': var omo =  " tip=\"en,menus,7\" " ; break;							default: var omo =  "" ;						}						document.write("<TR bgcolor='#FFFFFF'>\n"						+ "<TD width=35 align=center " + omo + "><font style=\"font-size: 10pt\">"+keys[k]+"</font></TD>\n"						+ "<TD>" 						+ p						+ "\n </TD></TR>\n\n" );					}					</script>					</table>				</div>				</td>			</tr>			</table>		</td>	</tr>	<tr>	<td align='center'>		<input style='width:80' type='button' id='new' value='New' class="buttonbold">&nbsp;		<input style='width:80' type='button' id='delete' value='Delete' class="buttonbold">&nbsp;	</td>	<td align='right'>		<input type="hidden" id="save">		<input type='button' id='savevmenu' onClick="save_vmenu()" value='Save' disabled class="buttonbold">&nbsp;		<input type='button' id='cancel' value='Cancel' class="buttonbold">&nbsp;	</td>	</tr></table></div><div id="NewStep_Content" STYLE="display:none; position: absolute; left: 40; top: 64; width:580; height:60;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:100">	<table width="100%" cellpadding=0 cellspacing=0  onmousedown="ASTGUI.startDrag(event , 'NewStep_Content');">	<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">		<TD tip="en,menus,2"><font color="#FFFFFF">&nbsp;&nbsp;<B>Add a new Step:</B></FONT></TD>		<TD Height="20" align="right" style="cursor: move">			<A href="#" onclick="hide_addStep();" style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</A>		</TD>		<TD width=4></TD>	</TR>	</table>	<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">	<tr>	<td colspan=2 class="field_text" align=center height=40 valign=middle>		<NOBR>		Add new Step: 		<select id='newstep_action' disabled onChange="update_newstep_var()" class="input8">			<option value=""> -- Select --</option>			<option value="Answer">Answer</option>			<option value="Authenticate">Authenticate</option>			<option value="Background">Background</option>			<option value="Busy">Busy Tone</option>			<option value="Congestion">Congestion</option>			<!-- <option value="SetMusicOnHold">SetMusicOnHold</option> -->			<option value="DigitTimeout">DigitTimeout</option>			<option value="DISA">DISA</option>			<option value="ResponseTimeout">ResponseTimeout</option>			<option value="Playback">Playback</option>			<option value="Wait">Wait</option>			<option value="WaitExten">WaitExten</option>			<option value="GotoMenu">Goto Menu</option>			<option value="GotoDirecotry">Goto Directory</option>			<option value="GotoExtension">Goto Extension</option>			<option value="GotoTimeBasedRule">Goto TimeBasedRule</option>			<option value="DialRingGroup">Dial RingGroup</option>			<option value="CheckOwnVoiceMail">Check Voicemail for Own Extension</option>			<option value="Hangup">Hangup</option>		</select>&nbsp;		<input type=text id="newstep_var" style="display:none" size=4 disabled class="input8">		<input type=text id="newstep_sounds" style="display:none" size=24 disabled class="input9">		<select id='add_newstep_extensions' style="display:none" onChange=" $('newstep_var').value = $('add_newstep_extensions').value;"   class="input8"></select>		<select id='add_newstep_menus' style="display:none" onChange=" $('newstep_var').value = $('add_newstep_menus').value;"   class="input8"></select>		<!-- <select style="display:none" id="tbr" class="input8" onChange=" $('newstep_var').value = $('tbr').value;"></select> -->		<select style="display:none" id="rgrp" class="input8" onChange=" $('newstep_var').value = $('rgrp').value;"></select>		<input type=text id="newstep_var_digit" size=3 style="display:none;" onChange=" $('newstep_var').value = $('newstep_var_digit').value;"  pattern='^\d*$' class="input8">&nbsp;		<input type=button style='width:45' id='addstep' onclick="add_newstep()"  value="Add" disabled  class="buttonbold">		<input type=button style='width:55' onclick="hide_addStep()"  value="Cancel" class="buttonbold">		</NOBR>		</td>	</tr>	</table></div><div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4"></div></body>

⌨️ 快捷键说明

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