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

📄 trunks.html

📁 asterisk 的图形管理界面
💻 HTML
📖 第 1 页 / 共 3 页
字号:
	var _allowed = _$('allowed') ;
	var _disallow = _$('disallow');
	var _disallowed = _$('disallowed');

	_disallow.value = "";
	_allow.value = "";
	if(_$('disallow_all').checked){
		_disallow.value = "all";
	}else{
		for (var x=0; x < _disallowed.length ; x++){
			if(x==0){
				_disallow.value = _disallowed.options[x].value ;
			}else{
				_disallow.value = _disallow.value + "," + _disallowed.options[x].value ;
			}
		}
	}

	for (var x=0; x < _allowed.length ; x++){
		if(x==0){
			_allow.value = _allowed.options[x].value ; 
		}else{
			_allow.value = _allow.value + "," +  _allowed.options[x].value ; 
		}
	}
	_$('save').disabled = false;
	_$('cancel').disabled = false;
}

function update_div_setordercodecs(){
	_$('disallowed').innerHTML=""; 	_$('allowed').innerHTML="";
	if( _$('disallow').value == "all" ){
		_$('disallow_all').checked = true;
		selectbox_add("disallowed", "ulaw");
		selectbox_add("disallowed", "alaw");
		selectbox_add("disallowed", "gsm");
		selectbox_add("disallowed", "ilbc");
		selectbox_add("disallowed", "speex");
		selectbox_add("disallowed", "g726");
		selectbox_add("disallowed", "adpcm");
		selectbox_add("disallowed", "lpc10");
		selectbox_add("disallowed", "g729");
	}else{
		var tmp = _$('disallow').value.split(",");
		for(var x=0; x < tmp.length; x++){
			selectbox_add("disallowed", tmp[x]);
		}
	}
	if(_$('allow').value =="all"){
		selectbox_add("allowed", "ulaw");
		selectbox_add("allowed", "alaw");
		selectbox_add("allowed", "gsm");
		selectbox_add("allowed", "ilbc");
		selectbox_add("allowed", "speex");
		selectbox_add("allowed", "g726");
		selectbox_add("allowed", "adpcm");
		selectbox_add("allowed", "lpc10");
		selectbox_add("allowed", "g729");
	}else{
		var tmp = _$('allow').value.split(",");
		for(var x=0; x < tmp.length; x++){
			selectbox_add("allowed", tmp[x]);
			selectbox_remove("disallowed",tmp[x]);
		}
	}
}

function disallow_all_refresh(){
	if( _$('disallow_all').checked ){
		_$('disallowed').innerHTML=""; 	_$('allowed').innerHTML="";
		_$('disallow').value = "all";
		_$('allow').value = "";
		update_div_setordercodecs();
		_$('save').disabled = false;
		_$('cancel').disabled = false;
	}
}


function saveSPdetails(){
	hideSPdetails();
	loadServiceProvidersintotable();
}

function hideSPdetails(){
	_$('userscontent').style.display = "none";
	_$('bg_transparent').style.display ='none';
}

function showSPdetails(){
	_$('cancel').disabled = false;
	_$('userscontent').style.display = "block";
	_$('bg_transparent').style.display ='';
	if ( isnewtrunk == 0){
		_$('trunkstyleanalog').disabled = true;
		_$('trunkstylevoip').disabled = true;
		_$('trunkstylecustomvoip').disabled = true;
		_$('provider').disabled = true;
	}
}

function deleteSP(trunk){
	var _devices = _$('devices');
	for(var i=0; i< _devices.length; i++){
		if(_devices.options[i].value == trunk){
			_devices.selectitem(i) ;
			_$('delete').disabled = 0;
			if( !_$('delete').click() ){ return; }
			break;
		}
	}
}

function deletesp_fromui(trunk){
	var delete_id = "row" + trunk;
	var _sp_t = _$('serviceproviderstable');
	for( var i=0; i <  _sp_t. rows.length; i++){
		if  ( _sp_t.rows[i].id == delete_id  ){
			_sp_t.deleteRow(i);
			loadServiceProvidersintotable();
			break;
		}
	}
}

function flip_register(){
	_$('cancel').disabled= false;
	_$('save').disabled= false;
	if( _$('customvoip_register').checked && _$('customvoip_protocol').value == "iax"){
		_$('registeriax').value = 'yes';
		_$('registersip').value = 'no';
	}
	if( _$('customvoip_register').checked && _$('customvoip_protocol').value == "sip"){
		_$('registeriax').value = 'no';
		_$('registersip').value = 'yes';
	}
	if( !_$('customvoip_register').checked ){
		_$('registeriax').value = 'no';
		_$('registersip').value = 'no';
	}
}

function free_mem( ){
	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 advanced_save(){
	_$('save').disabled = false;
	_$('save').click();
	_$('bg_transparent').style.display = "none";
	_$('advanced_content').style.display = "none";
}

function advanced_cancel(){
	_$('cancel').click();
	_$('bg_transparent').style.display = "none";
	_$('advanced_content').style.display = "none";
}

</script>
<body id="foo" onload="localajaxinit()"  bgcolor="EFEFEF"   onunload="free_mem()">
<div class="mainscreenTitleBar">
	<span style="margin-left: 4px;font-weight:bold;">Service Providers</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>

<select disabled size="1" id="devices" style="display:none"></select><input type='button' id='delete' value='Delete' style="display:none">
<BR>
<center>
<font size="+1">List of Service Providers</font>
<table class="table_black" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
	<tr>	<td width=40>S.No</td>
		<td width="200">Service Provider</td>
		<td>Type</td>
		<td width="90" align="center"></td>
	</tr>
</table>
<div style="width:500;height:250; overflow :auto;">
	<table id="serviceproviderstable" cellpadding=2 cellspacing=1 border=0 align=center width=500></table>
</div>
<input type='button' id='new' value='Add Service Provider'>
</center>
<!-- UsersContent DIV -->
<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:400;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
	<table width="100%" cellpadding=0 cellspacing=0>
		<TR bgcolor="#7E5538" style="background-image:url('images/title_gradient.gif');">
		<TD  onmousedown="startDrag(event , 'userscontent');" id="userscontent_title" style="cursor: move;color:#FFFFFF; font-size: 12px; font-weight:bold;" align="center"></TD>
		<TD Height="20" width=15 align="center"  style="color:#FFFFFF; font-size: 12px; font-weight:bold;" onclick="$('cancel').click();">X</TD>
		</TR>
	</table>
<table align="center" width=450>
<tr>
<td onmouseover="show_tooltip('en', 'trunks', 0);"  class="field_text" width=130 valign="top" align="left">
<!-- Provider type -->
	<div id='cabinet' style='width:0;overflow:hidden'><select id='hiddenglobals'></select></div>
	<fieldset>
		<legend><B>&nbsp;Provider Type:&nbsp;</B></legend>
		<LABEL FOR="trunkstyleanalog"><input name='trunkstyle' type='radio' id='trunkstyleanalog' onclick='activateanalogvoip()' value='analog'>Analog</LABEL><BR>
		<LABEL FOR="trunkstylevoip"><input name='trunkstyle' type='radio' id='trunkstylevoip' onclick='activateanalogvoip()' value='voip'>VoIP</LABEL><BR>
		<LABEL FOR="trunkstylecustomvoip"><input name='trunkstyle' type='radio' id='trunkstylecustomvoip' onclick='activateanalogvoip()' value='customvoip'>Custom VoIP</LABEL>
	</fieldset>
	<div id="div_providername" style="display:none">
		<BR><BR><B>Provider Name:</B><BR><input id="name" size=10 class='input8'>
	</div>
<!-- Provider type -->
</td>
<td>
<!-- Provider options -->
<div id='analogvoipcontainer' style='height:350;overflow:hidden' align="center">
<div id='analog' style='overflow:hidden' align="center">
	<table align="center">
	<tr onmouseover="show_tooltip('en', 'trunks', 2);"><td style='width:80px' valign='top' class="field_text">Lines:</td>
		<td>	<select size="12" multiple='true' id='zapchan' style='width:200px' class="input8"></select>
			<div id="zapchan_analoglines" style='height:110px; width: 200px; overflow :auto; display:none'></div>
		</td>
	</tr>
	<tr><td colspan='2' style='width:80px' valign='top' align='center'></td></tr>
	</table>
</div>
<div id='voip' style='height:0;overflow:hidden' align="center">
	<table align="center">
	<tr  onmouseover="show_tooltip('en', 'trunks', 1);">
		<td style='width:80px' valign='top' class="field_text">Provider:</td>
		<td><select size='6' id='provider' style='width:200px' altonchange='selectprovider()' class="input8"></select></td>
	</tr>
	<tr><td colspan='2' align='center'><A href="#" id="providerlink"><img id='providerlogo' style='visibility:hidden;' border=0></A></td></tr>
	<tr><td colspan='2' align='center'><div id='providerdesc' align='left' style='width:230px;height:100px; font-size:10px'></div></td></tr>
	<tr onmouseover="show_tooltip('en', 'trunks', 3);">
		<td class="field_text">Username:</td>
		<td><input size='20' id='username' class="input8"></td>
	</tr>
	<tr onmouseover="show_tooltip('en', 'trunks', 4);">
		<td class="field_text">Password:</td>
		<td><input type="password" size='20' id='secret' class="input8"></td>
	</tr>
	</table>
</div>
<div id='customvoip' align="center" style='display:none' align="center">
	<table align="center" cellpadding=2 cellspacing=1>
		<input id="trunkname" type="hidden">
		<input id="hasiax" type="hidden">
		<input id="hassip" type="hidden">
		<input id="hasexten" type="hidden">
		<input id="registeriax" type="hidden">
		<input id="registersip" type="hidden">
		<input id="host" type="hidden">
		<input id="dialformat" type="hidden">
		<input id="context" type="hidden">
		<input id="group" type="hidden">
		<tr>	<td height=10></td>
			<td></td>
		</tr>
		<tr>	<td class="field_text">Comment:</td>
			<td><input type="text" id="customvoip_name" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;"  class="input8"></td>
		</tr>
		<tr>	<td class="field_text">Protocol:</td>
			<td><select id="customvoip_protocol" onchange=" $('cancel').disabled= false;$('save').disabled= false;"  class="input8">
				<option value="iax">IAX</option>
				<option value="sip">SIP</option>
				</select>
			</td>
		</tr>
		<tr>	<td class="field_text">Register:</td>
			<td><input type="checkbox" id="customvoip_register" onchange="flip_register();"  class="input8"></td>
		</tr>
		<tr>	<td class="field_text">Host:</td>
			<td><input type="text" id="customvoip_host" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;"  class="input8"></td>
		</tr>
		<tr>	<td class="field_text">Username:</td>
			<td><input type="text" id="customvoip_username" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;"  class="input8"></td>
		</tr>
		<tr>	<td class="field_text">Password:</td>
			<td><input type="password" id="customvoip_secret" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;"  class="input8"></td>
		</tr>
	</table>
</div>
</div>
<!-- Provider options -->
</td>
</tr>
<tr><td></td><td align="center"><input type='button' id='save' value='Save' class="buttonbold">&nbsp;<input type='button' id='cancel' value='Cancel' class="buttonbold"></td></tr>
</table>
</div>
<!-- Users content DIV -->
<!-- Codecs content DIV -->
<div id="codecs_content" STYLE="display:none; position: absolute; left: 20; top: 125; width:350; height:245;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;z-index:5">
	<table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'codecs_content');">
	<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">
		<TD Height="20" align="center" style="cursor: move"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">Codec Preferences</font></TD>
		<TD Height="20" align="right" style="cursor: move"><A href="#" onclick="hide_codecs();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A></TD>
		<TD width=4></TD>
	</TR>
	</table>
	<table align=center>
		<tr><td><BR></td></tr>
		<tr><td class="field_text">Allowed</td>
			<td></td>
			<td class="field_text">Disallowed</td>
		</tr>
		<tr><td><select id="allowed" size=9 class="input8"></select></td>
			<td><input type="button" id="select_codec" value="<" onclick="enable_selectedcodec()"><BR>
				<input type="button" id="deselect_codec" value=">" onclick="disable_selectedcodec()"></td>
			<td><select id="disallowed" size=9 class="input8"></select></td>
		</tr>
		<tr><td></td>
			<td></td>
			<td class="field_text">
				<input id='allow' style="display:none">
				<input id='disallow'  style="display:none">
				<input type=checkbox id="disallow_all" onclick="disallow_all_refresh();">Disallow All
			</td>
		</tr>
		<tr><td colspan=3 align=Center>
			<input type="button" class="buttonbold" id="setordercodecs" value="update" onclick="codecs_save( )">&nbsp;&nbsp;
			<input type="button" class="buttonbold" id="cancel_setorder" value="Cancel" onclick="hide_codecs( )">
			</td>
		</tr>
		<tr><td><BR></td></tr>
	</table>
</div>
<!-- Codecs content DIV -->
<!-- Advanced content DIV -->
<div id="advanced_content" STYLE="display:none; position: absolute; left: 20; top: 125; width:350; height:197;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;z-index:7">
	<table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'advanced_content');">
	<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">
		<TD Height="20" align="center" style="cursor: move"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">Advanced Settings</font></TD>
		<TD Height="20" align="right" style="cursor: move"><A href="#" onclick="advanced_cancel();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A></TD>
		<TD width=4></TD>
	</TR>
	</table>
	<table align=center>
		<tr>	<td class="field_text">trunkname:</td>
			<td><input id="custom_trunkname" size=14  class="input8"></td>
		</tr>
		<tr>	<td class="field_text">insecure:</td>
			<td><input id="insecure" size=14  class="input8"></td>
		</tr>
		<tr>	<td class="field_text">port:</td>
			<td><input  id="port" size=14 class="input8"></td>
		</tr>
		<tr>	<td class="field_text">Caller Id:</td>
			<td><input type="text" id="callerid" size=14 class="input8"></td>
		</tr>
		<tr>	<td class="field_text">fromdomain:</td>
			<td><input type="text" id="fromdomain" size=14 class="input8"></td>
		</tr>
		<tr>	<td class="field_text">fromuser:</td>
			<td><input type="text" id="fromuser" size=14 class="input8"></td>
		</tr>
		<tr>	<td class="field_text">contact:</td>
			<td><input type="text" id="contact" size=14 class="input8"></td>
		</tr>
		<tr><td colspan=2 align=Center>
			<input type="button" class="buttonbold" value="update" onclick="advanced_save( )">&nbsp;&nbsp;
			<input type="button" class="buttonbold" value="Cancel" onclick="advanced_cancel( )">
			</td>
		</tr>
	</table>
</div>
<!-- Advanced content DIV -->
<div id="mymenu" class="mymenu" style="display:none"></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 + -