pari: trunk r420 - /trunk/config/trunks.html
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Tue Mar 13 20:14:58 MST 2007
Author: pari
Date: Tue Mar 13 22:14:57 2007
New Revision: 420
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=420
Log:
(experimental) Advanced settings in trunks
Modified:
trunk/config/trunks.html
Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=420&r1=419&r2=420
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Tue Mar 13 22:14:57 2007
@@ -41,7 +41,7 @@
'insecure', 'host', 'fromuser', 'fromdomain','contact','disallow','allow');
var provfieldnames = new Array('providerdesc', 'providerlogo');
var focus_fields = new Array('provider','username','secret','customvoip_name','customvoip_protocol',
- 'customvoip_host','customvoip_username','customvoip_secret','fromuser','contact');
+ 'customvoip_host','customvoip_username','customvoip_secret','fromuser','contact', "insecure", "port", "callerid", "fromdomain", "fromuser", "contact");
var isnewtrunk;
var dids_array = [];
@@ -274,10 +274,17 @@
callbacks.savechanges = function() {
if(isnewtrunk == 1){ //New Trunk created , add [DID_trunk_x] in extensions.conf
add_didcontext($('name').value);
+ if ($('trunkstylevoip').checked) {
+ $('dialformat').value = (provider.fieldbyname['dialformat']) ? provider.fieldbyname['dialformat'] : '${EXTEN:1}';
+ $('callerid').value = '';
+ $('insecure').value = (provider.fieldbyname['insecure']) ? provider.fieldbyname['insecure'] : '' ;
+ $('port').value = (provider.fieldbyname['port']) ? provider.fieldbyname['port'] : '' ;
+ $('fromuser').value = (provider.fieldbyname['fromuser']) ? provider.fieldbyname['fromuser'] : '' ;
+ if ($('fromuser').value == '<DID>') { $('fromuser').value = $('username').value; }
+ $('fromdomain').value = (provider.fieldbyname['fromdomain']) ? provider.fieldbyname['fromdomain'] : '' ;
+ }
}else{
- if(old_trunkname != $('name').value ){ // rename DID if needed
- update_didcontext(old_trunkname, $('name').value);
- }
+ if(old_trunkname != $('name').value ){ update_didcontext(old_trunkname, $('name').value); } // rename DID if needed
}
saveSPdetails();
var uri;
@@ -325,38 +332,6 @@
$('registeriax').value = provider.fieldbyname['registeriax'];
$('registersip').value = provider.fieldbyname['registersip'];
$('host').value = provider.fieldbyname['host'];
- if (provider.fieldbyname['dialformat'])
- $('dialformat').value = provider.fieldbyname['dialformat'];
- else
- $('dialformat').value = '${EXTEN:1}';
- $('callerid').value = '';
-
- if (provider.fieldbyname['insecure'])
- $('insecure').value = provider.fieldbyname['insecure'];
- else
- $('insecure').value = '';
- if (provider.fieldbyname['port'])
- $('port').value = provider.fieldbyname['port'];
- else
- $('port').value = '';
- //if (provider.fieldbyname['context'])
- // $('context').value = provider.fieldbyname['context'];
- //else
- // $('context').value = 'default';
- if (provider.fieldbyname['fromuser'])
- $('fromuser').value = provider.fieldbyname['fromuser'];
- else
- $('fromuser').value = '';
-
- if ($('fromuser').value == '<DID>') {
- $('fromuser').value = $('username').value;
- }
-
- if (provider.fieldbyname['fromdomain'])
- $('fromdomain').value = provider.fieldbyname['fromdomain'];
- else
- $('fromdomain').value = '';
-
for (var x=0;x<$('zapchan').options.length;x++)
$('zapchan').options[x].selected = false;
$('zapchan').value = '';
@@ -687,6 +662,29 @@
};
menu_div.appendChild(menuitem2);
+ var menuitem4 = document.createElement('div');
+ menuitem4.innerHTML = "Advanced" ;
+ menuitem4.onclick = function(){
+ hide_mymenu( );
+ for(var i=0; i< $('devices').length; i++){
+ if( this.parentNode.sp_value == $('devices').options[i].value ){
+ $('devices').selectitem(i);
+ $('bg_transparent').style.display = "";
+ $('advanced_content').style.display = "";
+ break;
+ }
+ }
+ };
+ menuitem4.onmouseover= function(){
+ document.getElementById('row'+this.parentNode.sp_value ).style.backgroundColor='#F6E7B6';
+ this.style.backgroundColor='#EFEFEF';
+ };
+ menuitem4.onmouseout=function(){
+ document.getElementById('row'+this.parentNode.sp_value ).style.backgroundColor='#FFFFFF';
+ this.style.backgroundColor='#FFFFFF';
+ };
+ menu_div.appendChild(menuitem4);
+
var menuitem3 = document.createElement('div');
menuitem3.innerHTML = "Delete" ;
menuitem3.onclick = function(){ hide_mymenu( ); deleteSP( this.parentNode.sp_value ); };
@@ -918,6 +916,20 @@
purge( document.body );
}catch(e){ }
}
+
+function advanced_save(){
+ alert( $('save').disabled );
+ $('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">
@@ -999,16 +1011,12 @@
<input id="hasiax" type="hidden">
<input id="hassip" type="hidden">
<input id="hasexten" type="hidden">
- <input id="callerid" 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">
- <input id="insecure" type="hidden">
- <input id="port" type="hidden">
- <input id="fromdomain" type="hidden">
<tr>
<td height=10></td>
<td></td>
@@ -1039,14 +1047,6 @@
<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>
- <tr>
- <td class="field_text">From User:</td>
- <td><input type="text" id="fromuser" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;" class="input8"></td>
- </tr>
- <tr>
- <td class="field_text">Contact:</td>
- <td><input type="text" id="contact" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;" class="input8"></td>
</tr>
</table>
</div>
@@ -1092,6 +1092,42 @@
</table>
</div>
<!-- Codecs content DIV -->
+<!-- Advanced content DIV -->
+<div id="advanced_content" STYLE="display:none; position: absolute; left: 20; top: 125; width:350; height:167; 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">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( )">
+ <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>
More information about the asterisk-gui-commits
mailing list