pari: branch 2.0 r3992 - in /branches/2.0/config: js/pbx.js trunks_voip.html
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Oct 21 15:38:21 CDT 2008
Author: pari
Date: Tue Oct 21 15:38:20 2008
New Revision: 3992
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3992
Log:
Fix for AA50-2233 : Cannot add VoIP service provider without a username and password
Modified:
branches/2.0/config/js/pbx.js
branches/2.0/config/trunks_voip.html
Modified: branches/2.0/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=3992&r1=3991&r2=3992
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Tue Oct 21 15:38:20 2008
@@ -887,12 +887,12 @@
addIAXTrunk: function( tr , cbf ){ //
// usage:: astgui_managetrunks.addIAXTrunk( {'host':'iaxtel.com' , username:'my_username', secret:'my_secret', ....}, cbf ) ;
- if( !tr.hasOwnProperty('host')|| !tr.hasOwnProperty('username') || !tr.hasOwnProperty('secret') ){ return false; } //check for required parameters
+ if( !tr.hasOwnProperty('host') ){ return false; } //check for required parameters
// add some default values for any IAXTrunk
// var trunk = astgui_managetrunks.misc.nextAvailableTrunk_x();
var tmp_trunksList = astgui_managetrunks.listofAllTrunks();
- var trunk = ( tmp_trunksList.contains(tr.username) ) ? astgui_managetrunks.misc.nextAvailableTrunk_x() : tr.username ;
+ var trunk = ( !tr.username || tmp_trunksList.contains(tr.username) ) ? astgui_managetrunks.misc.nextAvailableTrunk_x() : tr.username ;
sessionData.pbxinfo.trunks.iax[trunk] = new ASTGUI.customObject; // add new/reset iax trunk info in sessionData
@@ -945,7 +945,7 @@
addSIPTrunk: function(tr,cbf){ //
// usage:: astgui_managetrunks.addSIPTrunk( {'host':'sip_test.digium.com' , username:'my_username', secret:'my_secret',(required)fallback: '6001' ....}, cbf ) ;
- if( !tr.hasOwnProperty('host')|| !tr.hasOwnProperty('username') || !tr.hasOwnProperty('secret') ){ return false; } //check for required parameters
+ if( !tr.hasOwnProperty('host') ){ return false; } //check for required parameters
// add some default values for any SIPTrunk
tr.hasiax = 'no' ; tr.registeriax = 'no';
@@ -962,7 +962,7 @@
//var trunk = astgui_managetrunks.misc.nextAvailableTrunk_x();
var tmp_trunksList = astgui_managetrunks.listofAllTrunks();
- var trunk = ( tmp_trunksList.contains(tr.username) ) ? astgui_managetrunks.misc.nextAvailableTrunk_x() : tr.username ;
+ var trunk = ( !tr.username || tmp_trunksList.contains(tr.username) ) ? astgui_managetrunks.misc.nextAvailableTrunk_x() : tr.username ;
var ct = ASTGUI.contexts.TrunkDIDPrefix + trunk;
var x = new listOfActions();
Modified: branches/2.0/config/trunks_voip.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/trunks_voip.html?view=diff&rev=3992&r1=3991&r2=3992
==============================================================================
--- branches/2.0/config/trunks_voip.html (original)
+++ branches/2.0/config/trunks_voip.html Tue Oct 21 15:38:20 2008
@@ -235,11 +235,15 @@
var ttv = DOM_edit_VOIPTrunk_Type.value;
var trp = {
- host: DOM_edit_VOIPTrunk_Hostname.value ,
- username: DOM_edit_VOIPTrunk_Username.value ,
- secret: DOM_edit_VOIPTrunk_Password.value ,
+ host: DOM_edit_VOIPTrunk_Hostname.value ,
trunkname: ASTGUI.getFieldValue('edit_VOIPTrunk_Providername')
};
+
+ if( DOM_edit_VOIPTrunk_Username.value ){
+ trp.username = ASTGUI.getFieldValue(DOM_edit_VOIPTrunk_Username) ;
+ trp.secret = ASTGUI.getFieldValue(DOM_edit_VOIPTrunk_Password) ;
+ }
+
var cbf = function(){
ASTGUI.feedback({msg:'Created New ' + ttv+ ' trunk !', showfor: 3 , color: 'green', bgcolor: '#FFFFFF'}) ;
window.location.reload();
@@ -407,7 +411,7 @@
addCell( newRow , { html: parent.sessionData.pbxinfo.trunks[ttype][item]['trunkname'] } );
addCell( newRow , { html: ttype.toUpperCase() }); // sip/iax
addCell( newRow , { html: parent.sessionData.pbxinfo.trunks[ttype][item]['host'] });
- addCell( newRow , { html: parent.sessionData.pbxinfo.trunks[ttype][item]['username'] });
+ addCell( newRow , { html: parent.sessionData.pbxinfo.trunks[ttype][item]['username'] || '' });
var tmp_editString = "<span class='guiButton' onclick=\"edit_trunk_form('" + item +"')\">Edit</span> "
+ "<span class='guiButtonDelete' onclick=\"delete_trunk_confirm('" + item +"')\">Delete</span>" ;
More information about the asterisk-gui-commits
mailing list