pari: branch 2.0 r4363 - in /branches/2.0/config: ./ js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Dec 16 16:50:16 CST 2008


Author: pari
Date: Tue Dec 16 16:50:16 2008
New Revision: 4363

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4363
Log:

 New feature:

 new Option for 'Add new Step' in Voicemenus => Goto Destination if callerId Number matches a specified number.





Modified:
    branches/2.0/config/js/index.js
    branches/2.0/config/js/menus.js
    branches/2.0/config/menus.html

Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=4363&r1=4362&r2=4363
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Tue Dec 16 16:50:16 2008
@@ -833,7 +833,7 @@
 		});
 	},
 
-	getAllDestinations: function(){ // miscFunctions.getAllDestinations() // --> returns an Array of Objects
+	getAllDestinations: function(without_Goto){ // miscFunctions.getAllDestinations() // --> returns an Array of Objects
 	// There are various places in the gui where we want to preset a select box with all possible destinations
 	// for Example - in incoming calls, Voicemenus, RingGroups etc.
 	// this function navigates through all properties of sessionData.pbxinfo and returns an Array of Objects with all the possible destinations
@@ -909,6 +909,22 @@
 		tmp.push({ optionText: 'Operator' , optionValue: 'Goto(default,o,1)' });
 		tmp.push({ optionText: 'Hangup' , optionValue: 'Hangup' });
 		tmp.push({ optionText: 'Congestion' , optionValue: 'Congestion' });
+
+		if( without_Goto ){
+			var tmp_withoutGoto = [];
+			for( var t=0; t < tmp.length; t++ ){
+				if( tmp[t].optionValue.beginsWith('Goto(') ){
+
+					tmp_withoutGoto.push({
+						optionText	: tmp[t].optionText ,
+						optionValue	: tmp[t].optionValue.lChop('Goto(').rChop(')')
+					});
+
+				}
+			}
+			return tmp_withoutGoto;
+		}
+
 		return tmp;
 	},
 

Modified: branches/2.0/config/js/menus.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/menus.js?view=diff&rev=4363&r1=4362&r2=4363
==============================================================================
--- branches/2.0/config/js/menus.js (original)
+++ branches/2.0/config/js/menus.js Tue Dec 16 16:50:16 2008
@@ -261,6 +261,12 @@
 					$('#newstep_gotoDestination').show();
 					tip_chosenStep.innerHTML = '';
 					break;
+				case 'toDestinationByCallerId':
+					lbl('Goto Destiantion if CallerId is');
+					$('#newstep_pwd').val('').show();
+					$('#newstep_gotoDestinationByCallerId').show();
+					tip_chosenStep.innerHTML = 'Goto this destination, if callerId number matches the specified number';
+					break;
 				case 'setLanguage':
 					lbl('Set Language');
 					$('#newstep_setlanguage').show();
@@ -397,6 +403,12 @@
 				break;
 			case 'toDestination':
 				newstep = ASTGUI.getFieldValue('newstep_gotoDestination');
+				break;
+			case 'toDestinationByCallerId':
+				// newstep = 'GotoIf($["${CALLERID(num)}" == "newstep_pwd"]? newstep_gotoDestinationByCallerId )'
+				newstep = "GotoIf($[\"${CALLERID(num)}\" == \""
+ 					+ ASTGUI.getFieldValue('newstep_pwd')
+					+ "\"]?"+ ASTGUI.getFieldValue('newstep_gotoDestinationByCallerId') +")" ;
 				break;
 			case 'setLanguage':
 				newstep = 'Set(CHANNEL(language)=' + ASTGUI.getFieldValue('newstep_setlanguage') + ')';
@@ -607,9 +619,15 @@
 
 
 var updateVoiceMenus_Table = function(){
-	var someArray = parent.miscFunctions.getAllDestinations() ; 
-	ASTGUI.selectbox.populateArray('newstep_gotoDestination', someArray);
-	ASTGUI.selectbox.populateArray('kpe_destinations', someArray);
+	(function(){
+		var someArray = parent.miscFunctions.getAllDestinations() ;
+		ASTGUI.selectbox.populateArray('newstep_gotoDestination', someArray);
+
+		var someOtherArray = parent.miscFunctions.getAllDestinations(1) ;
+		ASTGUI.selectbox.populateArray('newstep_gotoDestinationByCallerId', someOtherArray);
+
+		ASTGUI.selectbox.populateArray('kpe_destinations', someArray);
+	})();
 	ASTGUI.selectbox.insert_before('kpe_destinations','None', '', 0);
 
 	$('#sqSteps').click(function(event){

Modified: branches/2.0/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/menus.html?view=diff&rev=4363&r1=4362&r2=4363
==============================================================================
--- branches/2.0/config/menus.html (original)
+++ branches/2.0/config/menus.html Tue Dec 16 16:50:16 2008
@@ -182,6 +182,7 @@
 							<option value="Wait">Wait</option>
 							<option value="WaitExten">WaitExten</option>
 							<option value="toDestination">Goto Destination</option>
+							<option value="toDestinationByCallerId">Goto Destination by CallerId</option>
 							<option value="setLanguage">Set Language</option>
 							<option value="GotoDirecotry">Goto Directory</option>
 							<option value="DialViaTrunk">Dial a Number via Trunk</option>
@@ -201,6 +202,7 @@
 						<select class='class_newStep_details_td' id="newstep_mohClass"></select>
 						<select class='class_newStep_details_td' id="newstep_disaContext"></select>
 						<select class='class_newStep_details_td' id="newstep_gotoDestination"></select>
+						<select class='class_newStep_details_td' id="newstep_gotoDestinationByCallerId"></select>
 						<select class='class_newStep_details_td' id="newstep_setlanguage">
 							<option value='en'>English</option>
 							<option value='es'>Spanish</option>




More information about the asterisk-gui-commits mailing list