pari: branch appliance r295 - in /branches/appliance: ./ config/ config/scrip...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Jan 25 12:47:21 MST 2007


Author: pari
Date: Thu Jan 25 13:47:20 2007
New Revision: 295

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=295
Log:
Merged revisions 254-255,260-269,271-272,277-283,285-289,291-292 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-gui/trunk

........
r254 | pari | 2007-01-15 18:04:11 -0600 (Mon, 15 Jan 2007) | 1 line

** Major Change in Trunks Naming convention** Trunk names in users.conf no longer needs to be in trunk_x format -- in order to facilitate user defined trunk names, which are help ful while setting up DIDs. Each trunk has an associated [asterisk_guiTDPrefix + trunkname] as context 
........
r255 | pari | 2007-01-15 18:53:11 -0600 (Mon, 15 Jan 2007) | 1 line

** Setup wizard changes needed due to previous commit **
........
r260 | pari | 2007-01-16 19:12:38 -0600 (Tue, 16 Jan 2007) | 1 line

BugFix: Clicking on the 'Home' panel while logged in is triggering two pollevents.
........
r261 | pari | 2007-01-16 19:50:52 -0600 (Tue, 16 Jan 2007) | 1 line

tweak- 0008726: Dynamically Generate list of sound files
........
r262 | pari | 2007-01-16 21:16:36 -0600 (Tue, 16 Jan 2007) | 1 line

Fix for -- 0008771: System happy to assign multiple extensions to the same analog line
........
r263 | pari | 2007-01-16 21:38:22 -0600 (Tue, 16 Jan 2007) | 1 line

bugfix: in setup wizard, service provider context is being set to 'default' instead of DID_context 
........
r264 | pari | 2007-01-16 22:10:24 -0600 (Tue, 16 Jan 2007) | 1 line

Bug Fix: During setup wizard - User Extensions page is not checking whether an entered user extension has been assinged to a Voicemail, voicemenu, queues or conferencing 
........
r265 | pari | 2007-01-16 22:15:19 -0600 (Tue, 16 Jan 2007) | 1 line

Bug fix: check for duplicate extensions before saving
........
r266 | pari | 2007-01-17 12:50:44 -0600 (Wed, 17 Jan 2007) | 1 line

if the localextenlength is changed the userbase will automatically be recalculated
........
r267 | pari | 2007-01-17 13:06:23 -0600 (Wed, 17 Jan 2007) | 1 line

Removing the onunload and onbeforeunload events as they are causing trouble while refreshing (F5)
........
r268 | pari | 2007-01-17 17:13:19 -0600 (Wed, 17 Jan 2007) | 1 line

lots of minor changes and fixes
........
r269 | pari | 2007-01-17 17:21:49 -0600 (Wed, 17 Jan 2007) | 1 line

that was stupid
........
r271 | pari | 2007-01-19 14:46:27 -0600 (Fri, 19 Jan 2007) | 1 line

tweaks: display no calling rules message in outgoing calls  and incoming calling rules pages
........
r272 | pari | 2007-01-19 14:56:25 -0600 (Fri, 19 Jan 2007) | 1 line

tweak: donot let user edit the serviceprovider type once it is added
........
r277 | pari | 2007-01-22 09:04:46 -0600 (Mon, 22 Jan 2007) | 1 line

0008882: Incoming call rules table not correctly formatted immediately after adding a rule
........
r278 | pari | 2007-01-22 11:44:49 -0600 (Mon, 22 Jan 2007) | 1 line

In Incoming Calls -> All unmatched incoming calls would add both  '_X.' and  's' extensions
........
r279 | pari | 2007-01-22 12:14:13 -0600 (Mon, 22 Jan 2007) | 1 line

 minor fix - 0008863
........
r280 | pari | 2007-01-22 12:22:34 -0600 (Mon, 22 Jan 2007) | 1 line

changing the Service Provider password field type from 'text' to 'password'
........
r281 | pari | 2007-01-22 12:39:36 -0600 (Mon, 22 Jan 2007) | 1 line

Fix for 0008823: GUI Voicemenu does not retain keypress 'GoToMenu' events (Can't get it to hold on to a menu tree.)
........
r282 | pari | 2007-01-22 12:59:09 -0600 (Mon, 22 Jan 2007) | 1 line

fix for 0008853: many service provider - missing scrollbar
........
r283 | pari | 2007-01-22 15:21:15 -0600 (Mon, 22 Jan 2007) | 1 line

bug fix: trunk name is set to trunk_username from providers.conf ONLY IF a predefined service provider is selected
........
r285 | pari | 2007-01-22 17:09:54 -0600 (Mon, 22 Jan 2007) | 1 line

fix for 0008879: System info / log doesn't filter out extraneous characters that may affect HTML formatting
........
r286 | pari | 2007-01-22 19:03:54 -0600 (Mon, 22 Jan 2007) | 1 line

Field validations for outbound calling Rules
........
r287 | pari | 2007-01-23 01:41:34 -0600 (Tue, 23 Jan 2007) | 1 line

in Commit 283 forgot to update the corresponding pahe n setup 
........
r288 | pari | 2007-01-23 15:34:23 -0600 (Tue, 23 Jan 2007) | 1 line

Bug Fix: 'New Entry' is being listed in List of Service providers after firest cancel, adding a service provider
........
r289 | pari | 2007-01-23 16:27:31 -0600 (Tue, 23 Jan 2007) | 1 line

Tweak: Donot let the pattern get added as a named extension  --  as Mark Dammer pointed out in http://forums.digium.com/viewtopic.php?t=12928 
........
r291 | pari | 2007-01-23 19:42:57 -0600 (Tue, 23 Jan 2007) | 1 line

feature: Replacing the extension text box in 'IncomingCalls' with a select box that lists all extensions
........
r292 | pari | 2007-01-24 01:58:21 -0600 (Wed, 24 Jan 2007) | 1 line

typo
........

Modified:
    branches/appliance/   (props changed)
    branches/appliance/config/cfgadvanced.html
    branches/appliance/config/cfgappliance.html
    branches/appliance/config/cfgbasic.html
    branches/appliance/config/home.html
    branches/appliance/config/homeapp.html
    branches/appliance/config/incoming.html
    branches/appliance/config/localexts.html
    branches/appliance/config/meetme.html
    branches/appliance/config/menus.html
    branches/appliance/config/numberplan.html
    branches/appliance/config/options.html
    branches/appliance/config/queues.html
    branches/appliance/config/record.html
    branches/appliance/config/scripts/astman.js
    branches/appliance/config/setup/1.html
    branches/appliance/config/setup/2.html
    branches/appliance/config/setup/3.html
    branches/appliance/config/setup/4.html
    branches/appliance/config/setup/5.html
    branches/appliance/config/setup/6.html
    branches/appliance/config/setup/7.html
    branches/appliance/config/sysinfo.html
    branches/appliance/config/trunks.html
    branches/appliance/config/users.html
    branches/appliance/config/voicemail.html

Propchange: branches/appliance/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 25 13:47:20 2007
@@ -1,1 +1,1 @@
-/trunk:1-243
+/trunk:1-294

Modified: branches/appliance/config/cfgadvanced.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/cfgadvanced.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/cfgadvanced.html (original)
+++ branches/appliance/config/cfgadvanced.html Thu Jan 25 13:47:20 2007
@@ -159,22 +159,6 @@
 	}
 
 	function registerajax() {
-		window.onbeforeunload = 	function(){
-				if(loggedon == 1)
-				return "Doing so will terminate your Asterisk GUI session"; 
-		}
-
-		window.onunload = 	function(){
-				if(loggedon != 1) return true;
-				var opt2 = {
-						method: 'get',asynchronous: true,
-						onSuccess: function() {setLoggedOn(0);loggedon == -1;},
-						onFailure: function(t) {}
-				};
-				opt2.parameters ="action=logoff";
-				var tmp2 = new Ajax.Request("../../rawman", opt2);
-		}
-
 		var pnameheight = 22;
 		var pheight = (503  - (pnameheight*panels.length) ) ;
 		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -229,7 +213,7 @@
 							<!-- <a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp; -->
 							<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
 							<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-							<a href="#">Help</a>&nbsp;
+							<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
 							<input type="hidden" id="login_name">
 							</td>
 </tr>

Modified: branches/appliance/config/cfgappliance.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/cfgappliance.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/cfgappliance.html (original)
+++ branches/appliance/config/cfgappliance.html Thu Jan 25 13:47:20 2007
@@ -150,22 +150,6 @@
 	}
 
 	function registerajax() {
-		window.onbeforeunload = 	function(){
-				if(loggedon == 1)
-				return "Doing so will terminate your Asterisk GUI session"; 
-		}
-
-		window.onunload = 	function(){
-				if(loggedon != 1) return true;
-				var opt2 = {
-						method: 'get',asynchronous: true,
-						onSuccess: function() {setLoggedOn(0);loggedon == -1;},
-						onFailure: function(t) {}
-				};
-				opt2.parameters ="action=logoff";
-				var tmp2 = new Ajax.Request("../../rawman", opt2);
-		}
-
 		var pnameheight = 22;
 		var pheight = (503  - (pnameheight*panels.length) )  ;
 		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -214,7 +198,7 @@
 <tr height=47><td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
 							<td valign='bottom' align='right' bgcolor='white' colspan=2><a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
 							<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-							<a href="#">Help</a>&nbsp;
+							<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
 							<input type="hidden" id="login_name">
 							</td>
 </tr>

Modified: branches/appliance/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/cfgbasic.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/cfgbasic.html (original)
+++ branches/appliance/config/cfgbasic.html Thu Jan 25 13:47:20 2007
@@ -153,22 +153,6 @@
 	}
 
 	function registerajax() {
-		window.onbeforeunload = 	function(){
-				if(loggedon == 1)
-				return "Doing so will terminate your Asterisk GUI session"; 
-		}
-
-		window.onunload = 	function(){
-				if(loggedon != 1) return true;
-				var opt2 = {
-						method: 'get',asynchronous: true,
-						onSuccess: function() {setLoggedOn(0);loggedon == -1;},
-						onFailure: function(t) {}
-				};
-				opt2.parameters ="action=logoff";
-				var tmp2 = new Ajax.Request("../../rawman", opt2);
-		}
-
 		var pnameheight = 22;
 		var pheight = (503  - (pnameheight*panels.length) ) ;
 		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -227,7 +211,7 @@
 									<!-- <a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp; -->
 									<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
 									<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-									<a href="#">Help</a>&nbsp;
+									<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
 									<input type="hidden" id="login_name">
 							</td>
 </tr>

Modified: branches/appliance/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/home.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/home.html (original)
+++ branches/appliance/config/home.html Thu Jan 25 13:47:20 2007
@@ -51,7 +51,6 @@
 			localloggedon = 1;
 			parent.document.getElementById('logoutlink').innerHTML = "Logout";
 			parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
-			parent.astmanEngine.pollEvents();
 			alert("You are using the default password provided by AsteriskNOW !! \n\n It is strongly recommended that you chnage your default password ");
 			window.location.href="options.html";
 			return;
@@ -72,7 +71,6 @@
 		$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.document.getElementById('logoutlink').innerHTML = "Logout";
 		parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
-		parent.astmanEngine.pollEvents();
 	}
 	
 	function loggedOff() {
@@ -94,6 +92,7 @@
 		resp = msgs[0].headers['response'];
 		if (resp == "Success" || msgs[0].headers['message'] == "Invalid/unknown command" ){
 			$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
+			parent.astmanEngine.pollEvents();
 			loggedOn();
 		}else
 			loggedOff();

Modified: branches/appliance/config/homeapp.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/homeapp.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/homeapp.html (original)
+++ branches/appliance/config/homeapp.html Thu Jan 25 13:47:20 2007
@@ -63,7 +63,7 @@
 		$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.document.getElementById('logoutlink').innerHTML = "Logout";
 		parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
-		parent.astmanEngine.pollEvents();
+		//parent.astmanEngine.pollEvents();
 	}
 	
 	function loggedOff() {
@@ -102,10 +102,12 @@
 	demo.logins = function(msgs) {
 		$('statusbar').innerHTML = msgs[0].headers['message'];
 		resp = msgs[0].headers['response'];
-		if (resp == "Success")
+		if (resp == "Success"){
+			parent.astmanEngine.pollEvents();
 			loggedOn();
-		else
+		}else{
 			loggedOff();
+		}
 	};
 	
 	demo.pongs  = function(msgs) {

Modified: branches/appliance/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/incoming.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/incoming.html (original)
+++ branches/appliance/config/incoming.html Thu Jan 25 13:47:20 2007
@@ -30,8 +30,19 @@
 var editstatus ;
 var old_incomingrule, old_fromprovider ;
 var  edit_pattern, edit_DIDtrunk, edit_action, edit_priority ;
+var listOfExtensions = [] ;	// to store all the list of extensions to be displayed in the select menu
 
 user_callbacks.format = function(t, x) {
+	var tmp = asterisk_guiTDPrefix + t.name ; 
+	if ( ( t.fieldbyname['context'] == tmp ) && x == undefined ) {
+		didtrunks[tmp] = new Object();
+		didtrunks[tmp].trunkname = t.fieldbyname['trunkname'] ; 
+		return t.name;
+	}
+	if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length && x == undefined && t.name != "general" ) {
+		listOfExtensions.push( t.name + " -- " + t.fieldbyname['fullname'] );
+	}
+	/*
 	var tmp = 'DID_' + t.name;
 	if ( t.name.substring(0,6) == 'trunk_' && x == undefined){
 		didtrunks[tmp] = new Object();
@@ -40,6 +51,7 @@
 	if ( t.name.substring(0,6) == 'trunk_'  && t.names[x]=='trunkname' ){
 		didtrunks[tmp].trunkname = t.fields[x];
 	}
+	*/
 	return false;
 }
 
@@ -52,16 +64,21 @@
 // parse all contexts in extensions.conf that look like [DID_trunk_x]
 // and show each entry in the table
 numplan_callbacks.format = function(t, x) {
-	if (t.name.substring(0,10) == 'DID_trunk_' && x == undefined){
+	if ((t.name == specialcontext && x != undefined )){
+		var p = format_extension( $('extensions'), t, x)  ;
+		if ( p != null ){ listOfExtensions.push(p); }
+	}
+	if (		( t.name.substring(0,asterisk_guiTDPrefix.length) == asterisk_guiTDPrefix ) && x == undefined){
 		if(typeof didtrunks[t.name] == "undefined"){
 			didtrunks[t.name] = new Object();
 			didtrunks[t.name].trunkname = t.name;
 		}
 		return t.name;
 	}
-	if (t.name.substring(0,10) == 'DID_trunk_' && t.names[x]=='exten' ){
+	if ( ( t.name.substring(0,asterisk_guiTDPrefix.length) == asterisk_guiTDPrefix ) && t.names[x]=='exten' ){
 		//get pattern & action
 		var temp = t.fields[x].split(',');
+		if( temp[0] == "s" ){return false;}
 		didtrunks[t.name][temp[0]] = new Object();
 		didtrunks[t.name][temp[0]].priority = temp[1];
 		didtrunks[t.name][temp[0]].action = temp[2];
@@ -70,6 +87,12 @@
 }
 
 numplan_callbacks.loaded = function() {
+	listOfExtensions.sort();
+	for(var a =0; a < listOfExtensions.length ; a++ ){
+		var b = listOfExtensions[a].split(' -- ');
+		$('toextension').innerHTML = $('toextension').innerHTML + "<option value='" + b[0] + "'>" + listOfExtensions[a] + "</option>";
+	}
+
 	// load list of trunks to 'fromprovider'
 	var t ;
 	for ( t in didtrunks){
@@ -105,6 +128,16 @@
 					addrowtotable( j, i, didtrunks[i][j].action, didtrunks[i][j].priority);
 			}
 	}
+
+	if( $('callingRulesTable').rows.length == 0){
+		$('table_one').style.display="none";
+		var newRow = $('callingRulesTable').insertRow(-1);
+		var newCell0 = newRow.insertCell(0);
+		newCell0 .align = "center";
+		newCell0 .innerHTML = "<BR>An <I>incoming Calling Rule</I> is not defined<BR><BR> Please click on 'Add a Incoming Rule' button<BR> to add a new incoming call rule.<BR><BR>" ;
+		return true;
+	}
+
 }
 
 function addrowtotable(a,b,c,d){	// a is pattern, b is DID_trunk, c is action, d is priority
@@ -148,7 +181,7 @@
 	$('fromprovider').selectedIndex = -1;
 	old_incomingrule = "allunmatched";
 	old_fromprovider = "";
-	$('toextension').value = "";
+	$('toextension').selectedIndex = -1;
 	$('frompattern').value = "";
 	$('save_a').disabled = true;
 	$('thatmatch').style.display = "none" ;
@@ -185,7 +218,13 @@
 	if( c.match("Goto") && !c.match("voicemenu-")  ){ 
 		var tmp = c.split('(');
 		var exten = tmp[1].split('|'); // extension is exten[1]
-		$('toextension').value = exten[1];
+		$('toextension').selectedIndex = -1 ;
+		for(var t=0; t < $('toextension').length ; t++ ){
+			if( $('toextension').options[t].value == exten[1] ){
+				$('toextension').selectedIndex = t;
+				break;
+			}
+		}
 	}
 
 	$('userscontent').style.display = "";
@@ -211,26 +250,39 @@
 		return false;
 	}
 	if( $('fromprovider').selectedIndex == -1 ){
-		alert("Please select a serive provider !");
+		alert("Please select a service provider !");
 		$('fromprovider').focus();
 		return false;
 	}
-	if( $('toextension').value == "" ){
+	if( $('toextension').selectedIndex == -1 ){
 		alert("Please select an extension to which an incoming call should be routed to !");
 		$('toextension').focus();
 		return false;
+	}
+
+	if($('incomingrule').value == "frompattern" && $('frompattern').value.substr(0,1) != "_" ){
+				$('frompattern').value = "_" + $('frompattern').value ;
 	}
 
 	// create an entry under the selected trunk
 	// $('incomingrule') == "allunmatched" or "frompattern" , $('frompattern'), $('fromprovider'), $('toextension')
 	if ($('incomingrule').value == "allunmatched" ){
-		var newpattern = "_X." ;
+			var newpattern = "_X." ;
+			var temp_provider = $('fromprovider').value;
+			var temp_priority = "1";
+			var temp_action = "Goto(default|" + $('toextension').value + "|1)";
+			var new_exten = newpattern  + "," + temp_priority + "," + temp_action;
+			var new_exten2 = "s,1," + temp_action;
+			var uri = build_action('append', 0, temp_provider ,"exten", new_exten);
+			uri += build_action('append', 1, temp_provider ,"exten", new_exten2);
 	}else{
-		var newpattern = $('frompattern').value ;
-	}
-	var temp_provider = $('fromprovider').value ;
-	var temp_action = "Goto(default|" + $('toextension').value + "|1)";
-	var temp_priority = "1";
+			var newpattern = $('frompattern').value ;
+			var temp_provider = $('fromprovider').value ;
+			var temp_action = "Goto(default|" + $('toextension').value + "|1)";
+			var temp_priority = "1";
+			var new_exten = newpattern  + "," + temp_priority + "," + temp_action;
+			var uri = build_action('append', 0, temp_provider ,"exten", new_exten ); 
+	}
 
 	// check whether there is an existing entry with this pattern 
 	if( typeof didtrunks[temp_provider][newpattern] != "undefined" ){
@@ -246,7 +298,8 @@
 				didtrunks[temp_provider][newpattern] = new Object();
 				didtrunks[temp_provider][newpattern].priority = temp_priority;
 				didtrunks[temp_provider][newpattern].action = temp_action ;
-				addrowtotable(newpattern,temp_provider,temp_action,temp_priority) ; // a is pattern, b is DID_trunk, c is action, d is priority
+				//addrowtotable(newpattern,temp_provider,temp_action,temp_priority) ; // a is pattern, b is DID_trunk, c is action, d is priority
+				refreshtable();
 				$('userscontent').style.display = "none";
 				$('bg_transparent').style.display ='none';
 			},
@@ -254,8 +307,7 @@
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			}
 		};
-		var new_exten = newpattern  + "," + temp_priority + "," + temp_action;
-		var uri = build_action('append', 0, temp_provider ,"exten", new_exten ); 
+
 		opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 		var tmp = new Ajax.Request("../../rawman", opt);
 	// 
@@ -270,28 +322,45 @@
 		$('frompattern').select();
 		return false;
 	}
-	if( $('toextension').value == "" ){
+	if( $('toextension').selectedIndex == -1 ){
 		alert("Please select an extension to which an incoming call should be routed to !");
 		$('toextension').focus();
 		return false;
 	}
 
+	if($('incomingrule').value == "frompattern" && $('frompattern').value.substr(0,1) != "_" ){
+				$('frompattern').value = "_" + $('frompattern').value ;
+	}
 	// old values before editing are - edit_pattern, edit_DIDtrunk, edit_action, edit_priority
 	// check for duplicate other than old
-	if ($('incomingrule').value == "allunmatched" ){
-		var newpattern = "_X." ;
-	}else{
-		var newpattern = $('frompattern').value ;
-	}
+	var p = 0 ;
+	var uri = "" ;
 	var temp_provider = $('fromprovider').value ;
 	var temp_action = "Goto(default|" + $('toextension').value + "|1)";
 	var temp_priority = "1";
+	var tmp_old_string = edit_pattern  + "," + edit_priority + "," + edit_action;
+	uri += build_action('delete', p, edit_DIDtrunk ,"exten", "", tmp_old_string); p++;
+	if(edit_pattern == "_X." ){
+		var tmp2_old_string = "s," + edit_priority + "," + edit_action ;
+		uri += build_action('delete', p, edit_DIDtrunk ,"exten", "", tmp2_old_string); p++;
+	}
+
+	if ($('incomingrule').value == "allunmatched" ){
+		var newpattern = "_X." ;
+		var new_exten = newpattern  + "," + temp_priority + "," + temp_action;
+		var new_exten2 = "s," + temp_priority + "," + temp_action;
+		uri += build_action('append', p , temp_provider ,"exten", new_exten ); p++ ;
+		uri += build_action('append', p , temp_provider ,"exten", new_exten2 ); p++ ;
+	}else{
+		var newpattern = $('frompattern').value ;
+		var new_exten = newpattern  + "," + temp_priority + "," + temp_action;
+		uri += build_action('append', p , temp_provider ,"exten", new_exten ); p++ ;
+	}
 
 	if( typeof didtrunks[temp_provider][newpattern] != "undefined" && ( temp_provider != edit_DIDtrunk || newpattern != edit_pattern ) ){
 		alert("An incoming call rule is already defined \n on this trunk for the selcted pattern !! ");
 		return false;
 	}
-	
 
 	// delete old entry and add new entry
 	var opt = {
@@ -310,11 +379,6 @@
 			alert("Config Error: " + t.status + ": " + t.statusText);
 		}
 	};
-	var tmp_old_string = edit_pattern  + "," + edit_priority + "," + edit_action;
-	var uri = build_action('delete', 0, edit_DIDtrunk ,"exten", "", tmp_old_string); 
-	var new_exten = newpattern  + "," + temp_priority + "," + temp_action;
-	uri+= build_action('append', 1, temp_provider ,"exten", new_exten ); 
-
 	opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 	var tmp = new Ajax.Request("../../rawman", opt);
 
@@ -370,6 +434,10 @@
 			}
 		};
 		var uri = build_action('delete',0, b, "exten" ,"", tmp_match);
+		if( a == "_X." ){
+			var tmp2_match = "s," + d + "," + c ;
+			uri += build_action('delete',1,b,"exten","", tmp2_match);
+		}
 		opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 		var tmp = new Ajax.Request("../../rawman", opt);
 }
@@ -425,7 +493,7 @@
 			</TR>
 			<TR><TD align=center>from provider <select id="fromprovider" onclick="checksave(this)"></select></TD></TR>
 			<TR>
-				<TD align=center>to extension <input type="text" id="toextension" size=5 onchange="enablesave();"  onkeyup="enablesave();"></TD>
+				<TD align=center>to extension <select id="toextension" onchange="enablesave();"  onkeyup="enablesave();"></select></TD>
 			</TR>
 			<TR>
 				<TD align=center height=50 valign=middle>  

Modified: branches/appliance/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/localexts.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/localexts.html (original)
+++ branches/appliance/config/localexts.html Thu Jan 25 13:47:20 2007
@@ -26,12 +26,10 @@
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
 var usercallbacks = new Object;
-var fieldnames = new Array('status', 'save','userbase','localextenlength');
+var fieldnames = new Array('status', 'save','userbase','localextenlength','allow_aliasextns');
 var widgets = new Array;
 
 function tosetup(){
-	parent.window.onbeforeunload = function(){ }
-	parent.window.onunload = function(){ }
 	parent.window.location.href = "./setup/install.html";
 }
 
@@ -85,8 +83,24 @@
 				widgets[fieldnames[x]] = $(fieldnames[x]);
 				widgets[fieldnames[x]].disabled = true;
 			}
+			$('localextenlength').addEventListener("change", update_spae, false);
 			parent.astmanEngine.config2list("users.conf", $('devices'),widgets, usercallbacks);
 }
+
+
+function update_spae(){
+		if(	$('localextenlength').value == $('userbase').value.length ) return;
+		if(	$('localextenlength').value < $('userbase').value.length ){
+				$('userbase').value = $('userbase').value.substr(0,$('localextenlength').value);
+				return;
+		}
+		if(	$('localextenlength').value > $('userbase').value.length ){
+				while ( $('localextenlength').value != $('userbase').value.length  ){
+					$('userbase').value = $('userbase').value + "0" ; 
+				}
+		}
+}
+
 </script>
 <body id="foo" onload="localajaxinit()" bgcolor="EFEFEF">
 <div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options - Local Extension Settings</span></div>
@@ -104,6 +118,7 @@
 					<select id="devices" style="display:none"></select> 
 					<p class="field_text">	Local Extensions are <select id="localextenlength"><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select> digits long&nbsp;</p>
 					<p class="field_text">	Starting point of Allocation of extensions : <input type=text id="userbase" size=5>	</p>
+					<p class="field_text"> <input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</p>
 					<center>
 							<div style="height:15px" id='status'></div><BR>
 							<input type=button id="save" value="Save">

Modified: branches/appliance/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/meetme.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/meetme.html (original)
+++ branches/appliance/config/meetme.html Thu Jan 25 13:47:20 2007
@@ -35,6 +35,7 @@
 	var callbacks = new Object;
 	var usercallbacks = new Object;
 	var localextenlength;
+	var temp_selectedexten;
 	var fieldnames = new Array(
 				'name', 'delete', 'status', 'newitem', 
 				'music','menu', 'announce',
@@ -175,6 +176,7 @@
 				alert(" You can not edit the selected entry from here.\n Please click on the \'Users\' panel to edit the selected entry");
 				return true;
 		}
+		temp_selectedexten = $('name').value;
 	}
 	callbacks.newcategory = function() {
 		var tmp = null;
@@ -200,6 +202,17 @@
 		if (!check_patternonfields( ['name', 'pin' , 'pinadmin', 'room'] ) ){
 			return false;
 		}
+
+		if(temp_selectedexten != $('name').value ){
+			for(var k=0; k<$('extensions').length; k++ ){
+				var tmp = $('extensions').options[k].innerHTML.split(' -- '); 
+				if( tmp[0] ==  $('name').value   ){
+					alert("Sorry, an entry named " + $('name').value + " already exists!");
+					return false;
+				}
+			}
+		}
+
 		return true;
 	}
 	callbacks.identifier = "extension";
@@ -214,8 +227,13 @@
 			}
 			return null;
 		}
-		if (t.name.substring(0,6) == 'trunk_')
+
+		//if (t.name.substring(0,6) == 'trunk_')
+		//	return null;
+		if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {
 			return null;
+		}
+
 		if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
 			return t.name + " -- " + t.fieldbyname['fullname'];
 		} else

Modified: branches/appliance/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/menus.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/menus.html (original)
+++ branches/appliance/config/menus.html Thu Jan 25 13:47:20 2007
@@ -40,6 +40,8 @@
 	var extensions_array = new Array;
 	var answer_call_string = "s,1,Answer";
 	var localextenlength ;
+	var rfilescallbacks = new Object;
+	var custom_voicemenusfile = "gui_custommenus.conf";
 
 function format_step(this_step){
 	var temp = this_step.split(',');
@@ -132,7 +134,7 @@
 		var tmp = menustring.split('(');
 		var tmp1 = tmp[1].split('|');
 		for(y=0; y < $(my_field_options).options.length; y++ ){
-			if( $(my_field_options).options[y].value == tmp1[1]){
+			if( $(my_field_options).options[y].value == tmp1[0]){
 				$(my_field_options).options[y].selected = true;
 				return true;
 			}
@@ -960,8 +962,21 @@
 	return res;
 }
 
+
+rfilescallbacks.format = function(t) {
+		return t.name;
+}
+
+rfilescallbacks.loaded= function() {
+	for (var i=0; i < $('recorded_files').length; i++){
+		var tmp_fname = $('recorded_files').options[i].value.slice(0, -4);
+		$('combosel_sounds').innerHTML += '<option value="'+ tmp_fname + '">' + tmp_fname + "</option>" ;
+	}
+	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), usercallbacks);
+}
+
 extencallbacks.loaded = function() {
-	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), usercallbacks);
+	parent.astmanEngine.config2list(custom_voicemenusfile, $('recorded_files'), new Array, rfilescallbacks);
 }
 
 extencallbacks.eachline = true;
@@ -977,10 +992,14 @@
 			}
 			return null;
 		}
-		if (t.name.substring(0,6) == 'trunk_')
+
+		//if (t.name.substring(0,6) == 'trunk_')
+		//	return null;
+		if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {
 			return null;
-		else
+		}else{
 			return t.name;
+		}
 }
 
 usercallbacks.identifier = "extension";
@@ -1015,7 +1034,7 @@
 			<select size="20" id="vmenus" style="width:180px; height: 415px" class="input10">
 			<option>Loading...</option>
 			</select>
-			<div style='visibility:hidden;overflow:hidden;width:0px;height:0px'><select id='extensions'></select><select id='users'></select></div>
+			<div style='visibility:hidden;overflow:hidden;width:0px;height:0px'><select id='extensions'></select><select id='users'></select><select id='recorded_files'></select></div>
 		</td>
 		<td valign=top align="right" width=346 height=415>
 						<table align="center" width="346">
@@ -1266,6 +1285,7 @@
 																	<option value="vm-unknown-caller">vm-unknown-caller</option>
 																	<option value="vm-whichbox">vm-whichbox</option>
 																	<option value="vm-youhave">vm-youhave</option>
+															<option value="" style="font-weight: bold">Recorded Voicemenus</option>
 													</select>
 											</div>
 											<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;

Modified: branches/appliance/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/numberplan.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/numberplan.html (original)
+++ branches/appliance/config/numberplan.html Thu Jan 25 13:47:20 2007
@@ -66,8 +66,11 @@
 
 
 trunkcallbacks.format = function(t) {
-	if (t.name.substr(0,6) != 'trunk_')
+	//if (t.name.substr(0,6) != 'trunk_')
+	//	return null;
+	if ( t.fieldbyname['context'] != asterisk_guiTDPrefix + t.name ) {
 		return null;
+	}
 	if (t.fieldbyname['trunkname'] && t.fieldbyname['trunkname'].length) {
 		trunks_desc[t.name] = new Object();
 		trunks_desc[t.name].comment = t.fieldbyname['trunkname'] ;
@@ -139,6 +142,7 @@
 	}
 	// now show this object in a table.
 	var rules_nosp = new Array ;
+
 	for( var x in  default_np_data ){	// x is the pattern
 			// sort the priorities
 			if ( x == "extend"){ break;}
@@ -150,6 +154,7 @@
 			sorted_priorities.sort();
 			// done sorting priorities
 			// show fields in a table in the order of sorted priorities
+
 			for( var z=0; z < sorted_priorities.length ; z++ ){
 				//check if the trunk defined is actually an existing trunk
 				var trunk_exists = 0;
@@ -175,8 +180,17 @@
 			}
 	} 
 	if(rules_nosp.length > 0 ){
-		$('status').innerHTML = "Note: A Service Provider is not defined for the Rules <BR>" + rules_nosp ;
+		$('status').innerHTML = "Note: A Service Provider is not defined for the Rule(s) <BR>" + rules_nosp ;
 		$('trunks').selectedIndex = -1;
+	}
+
+	if( $('callingRulesTable').rows.length == 0 ){
+		$('table_one').style.display="none";
+		var newRow = $('callingRulesTable').insertRow(-1);
+		var newCell0 = newRow.insertCell(0);
+		newCell0 .align = "center";
+		newCell0 .innerHTML = "<BR>A <I>Calling Rule</I> is not defined<BR><BR> Please click on the 'Add a Calling Rule' button<BR> to add a Calling Rule<BR><BR>" ;
+		return true;
 	}
 }
 
@@ -395,6 +409,7 @@
 
 
 function saverule(){
+	if ( !checkfields() ) return false;
 	 if(isnewrule){ // add this rule to the default plan and reload the page
 					var newpriority=1;
 					if( typeof default_np_data[$('pattern').value] !="undefined" ){
@@ -435,6 +450,29 @@
 function localajaxinit(){
 	$('message_text').innerHTML ="Saving Changes...";
 	parent.astmanEngine.config2list("users.conf", $('trunks'), new Array(), trunkcallbacks);
+}
+
+function checkfields(){
+	if( $('rulename').value.length == 0 ){
+		alert("Please enter a Rule Name");
+		$('rulename').focus();
+		return false;
+	}
+	if($('trunks').selectedIndex == -1){
+		alert("Please select a service provider to place this call through");
+		return false;
+	}
+	if($('define_advanced').style.display=="none" && $('beginswith').value.length==0 ){
+		alert("Please Enter the beginning pattern of the number");
+		$('beginswith').focus();
+		return false;
+	}
+	if($('define_usual').style.display=="none" && $('pattern').value.length == 0 ){
+		alert("Please Enter a custom pattern");
+		$('pattern').focus();
+		return false;
+	}
+return true;
 }
 </script>
 <body id="foo" onload="localajaxinit()"  bgcolor="EFEFEF">
@@ -486,7 +524,7 @@
 		<TR id="define_usual" height=100>
 			<TD valign="top" align=right>Dialing Rules :</TD>
 			<TD valign="top"> If the number begins with <input id="beginswith" type='text' size=6 onChange="enablesave();" onkeyup="enablesave();"> and 
-					followed by <input id="followedby" type='text' size=1> digits <input type="checkbox" id="ormore" onChange="enablesave();"> or more <BR>
+					followed by <input id="followedby" type='text' size=1 onChange="enablesave();" onkeyup="enablesave();"> digits <input type="checkbox" id="ormore" onChange="enablesave();"> or more <BR>
 					<A href="#" onclick="ownpattern();">(define a custom pattern)</A>
 			</TD>
 		</TR>

Modified: branches/appliance/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/options.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/options.html (original)
+++ branches/appliance/config/options.html Thu Jan 25 13:47:20 2007
@@ -210,8 +210,6 @@
 
 
 function tosetup(){
-	parent.window.onbeforeunload = function(){ }
-	parent.window.onunload = function(){ }
 	parent.window.location.href = "./setup/install.html";
 }
 

Modified: branches/appliance/config/queues.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/queues.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/queues.html (original)
+++ branches/appliance/config/queues.html Thu Jan 25 13:47:20 2007
@@ -156,8 +156,8 @@
 						return;
 					}
 
-					for(k=0; k<$('queues').length; k++ ){
-						tmp = $('queues').options[k].innerHTML.split(' -- '); 
+					for(var k=0; k<$('queues').length; k++ ){
+						var tmp = $('queues').options[k].innerHTML.split(' -- '); 
 						if( tmp[0] ==  $('name').value   ){
 							alert("Sorry, an entry named " + $('name').value + " already exists!");
 							return;
@@ -289,8 +289,11 @@
 			if ( t.fieldbyname['userbase'] && t.fieldbyname['userbase'].length){ userbase =  t.fieldbyname['userbase'] ; }
 			return null;
 		}
-		if (t.name.substring(0,6) == 'trunk_')
+		//if (t.name.substring(0,6) == 'trunk_')
+		//	return null;
+		if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {
 			return null;
+		}
 		if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
 			return t.name + " -- " + t.fieldbyname['fullname'];
 		} else

Modified: branches/appliance/config/record.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/record.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/record.html (original)
+++ branches/appliance/config/record.html Thu Jan 25 13:47:20 2007
@@ -186,8 +186,11 @@
 callbacks.format = function(t) {
 	if ((t.name == 'general'))
 		return null;
-	if (t.name.substring(0,6) == 'trunk_')
-		return null;
+	//if (t.name.substring(0,6) == 'trunk_')
+	//	return null;
+	if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {
+			return null;
+	}
 	if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
 		return t.name + " -- " + t.fieldbyname['fullname'];
 	} else

Modified: branches/appliance/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/scripts/astman.js?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/scripts/astman.js (original)
+++ branches/appliance/config/scripts/astman.js Thu Jan 25 13:47:20 2007
@@ -25,6 +25,7 @@
  var asterisk_guiversion = "$Revision$";
 var sortbynames = false;
 var dragdata = new Object;
+var asterisk_guiTDPrefix = "DID_";
 
 function startDrag(event, movethis ){
 	dragdata.movethis = movethis ;

Modified: branches/appliance/config/setup/1.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/1.html?view=diff&rev=295&r1=294&r2=295
==============================================================================
--- branches/appliance/config/setup/1.html (original)
+++ branches/appliance/config/setup/1.html Thu Jan 25 13:47:20 2007
@@ -37,6 +37,7 @@
 		if ( originalRequest.responseText.match("Error") ) {
 			// User is not logged in , show him the login screen
 			$('loginform').style.display = "block";
+			$('username').focus();
 			return true;
 		}
 		if ( originalRequest.responseText.match("Pong") ) {

[... 1056 lines stripped ...]


More information about the asterisk-gui-commits mailing list