pari: branch 2.0 r3659 - in /branches/2.0/config: js/astman.js menus.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Aug 12 17:24:21 CDT 2008


Author: pari
Date: Tue Aug 12 17:24:20 2008
New Revision: 3659

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

 New Feature: expose 'Dial' command in voicemenus !



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

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=3659&r1=3658&r2=3659
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Tue Aug 12 17:24:20 2008
@@ -1448,6 +1448,15 @@
 			var q_LC = q.toLowerCase();
 			var all_LC = app.toLowerCase() ;
 
+			if( all_LC == "macro" ){
+				if( args[0] && args[0].contains('trunkdial-failover') && args[1] ){
+					var tmp_trunkDetails = ASTGUI.parseContextLine.parseTrunkDialArgument(args[1]);
+					var tmp_trunkString = (tmp_trunkDetails.name) ? ' using trunk ' + tmp_trunkDetails.name : ' via ' + tmp_trunkDetails.channel ;
+					return 'Dial ' + tmp_trunkDetails.prepend + tmp_trunkString ;
+				}
+				return 'Run Macro ' + (args[0] || '???');
+			}
+
 			if( all_LC == "answer" ){
 				return 'Answer the call'
 			}
@@ -1506,10 +1515,6 @@
 
 			if( all_LC == "setmusiconhold" ){
 				return "Set Music-On-Hold class '" + (args[0] || 'default') + "'" ;
-			}
-
-			if( all_LC == "macro" ){
-				return 'Run Macro ' + (args[0] || '???');
 			}
 
 			if( all_LC == "meetme" ){

Modified: branches/2.0/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/menus.html?view=diff&rev=3659&r1=3658&r2=3659
==============================================================================
--- branches/2.0/config/menus.html (original)
+++ branches/2.0/config/menus.html Tue Aug 12 17:24:20 2008
@@ -282,6 +282,14 @@
 					lbl('Hangup');
 					tip_chosenStep.innerHTML = 'Hang up the calling channel';
 					break;
+				case 'DialViaTrunk':
+					lbl('Dial an external Number');
+					tip_chosenStep.innerHTML = 'Place a call outside the pbx using the selected trunk.';
+					$('#newstep_dial_ThisNumber').show();
+					$('#newstep_dial_ViaTrunk').show();
+					_$('newstep_dial_ThisNumber').value = '';
+					_$('newstep_dial_ViaTrunk').selectedIndex = -1 ;
+					break;
 				default:
 					break;
 			}
@@ -357,6 +365,10 @@
 				break;
 			case 'Hangup':
 				newstep = 'Hangup()';
+				break;
+			case 'DialViaTrunk':
+				var tmp_trunkName = ASTGUI.getFieldValue('newstep_dial_ViaTrunk');
+				newstep =  'Macro('+ ASTGUI.contexts.dialtrunks + ',${' + tmp_trunkName + '}/'+ ASTGUI.getFieldValue('newstep_dial_ThisNumber') +',,'+ tmp_trunkName + ',)' ;
 				break;
 			default:
 				break;
@@ -654,6 +666,20 @@
 	})();
 
 	(function(){
+		var t = ASTGUI.cloneObject( parent.astgui_managetrunks.listofAllTrunks() ) ;
+		var TMP_FORSORT = [];
+		t.each(function(item){
+			TMP_FORSORT.push( parent.astgui_managetrunks.misc.getTrunkName(item) + ':::::::' +  item);
+		});
+		TMP_FORSORT.sort();
+		var trunks_selectbox = _$('newstep_dial_ViaTrunk');
+		TMP_FORSORT.each( function(this_str){
+			var a = this_str.split(':::::::');
+			ASTGUI.selectbox.append( trunks_selectbox, 'via Trunk ' + a[0], a[1] );
+		});
+	})();
+
+	(function(){
 		var mcls = config2json({filename: 'musiconhold.conf', catlist:'yes'});
 		mcls.each( function(this_class){
 			ASTGUI.selectbox.append('newstep_mohClass', this_class, this_class );
@@ -772,6 +798,7 @@
 							<option value="toDestination">Goto Destination</option>
 							<option value="setLanguage">Set Language</option>
 							<option value="GotoDirecotry">Goto Directory</option>
+							<option value="DialViaTrunk">Dial a Number via Trunk</option>
 <!--							<option value="CheckOwnVoiceMail">Check Voicemail for Own Extension</option>-->
 							<option value="Hangup">Hangup</option>
 						</select>
@@ -791,6 +818,8 @@
 							<option value='es'>Spanish</option>
 							<option value='fr'>French</option>
 						</select>
+						<input class='class_newStep_details_td' id="newstep_dial_ThisNumber" size=10>
+						<select class='class_newStep_details_td' id="newstep_dial_ViaTrunk"></select>
 					</td>
 					<td>
 						<span class='guiButton' onclick='VoiceMenus_miscFunctions.push_newstep();'>&uarr; Add new Step</span>




More information about the asterisk-gui-commits mailing list