rbrindley: branch rbrindley/vmenus_revamp r4475 - /team/rbrindley/vmenus_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Jan 23 16:31:04 CST 2009


Author: rbrindley
Date: Fri Jan 23 16:31:04 2009
New Revision: 4475

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

- added editCancel, editSave, and editShow functions to all Actions
- removed 'CheckOwnVoicemail' action


Modified:
    team/rbrindley/vmenus_revamp/config/menus2.html

Modified: team/rbrindley/vmenus_revamp/config/menus2.html
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/vmenus_revamp/config/menus2.html?view=diff&rev=4475&r1=4474&r2=4475
==============================================================================
--- team/rbrindley/vmenus_revamp/config/menus2.html (original)
+++ team/rbrindley/vmenus_revamp/config/menus2.html Fri Jan 23 16:31:04 2009
@@ -324,14 +324,40 @@
 	var actions = new Array(
 		{ name: 'Answer', 
 			command: 'Answer()', 
-			desc: 'The Answer application is designed to signal to the caller that its destination has been reached.' },
+			desc: 'If the call has not been answered, this application will answer it. Otherwise, it has no effect on the call.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}},
 		{ name: 'Authenticate', 
 			command: 'Authenticate(1234)', 
-			desc: 'Authenticate is often used to verify that the caller acknowledges a certain key combination.' },
+			desc: 'This application asks the caller to enter a given password in order to continue dialplan execution. If the password begins with a \'/\' character, it is interpreted as a file which contains a list of valid passwords, listed 1 password per line in the file. Users have three attempts to authenticate before the channel is hung up.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var pwd  = $(e.target).parents('.edit').find('input.pwd').attr('value');
+				var command = "Authenticate("+pwd+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('pwd').attr('value','1234'));
+				form.prepend($("<span></span>").html('Please insert the numerical code that you\'d like to be authenticated: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.pwd').focus().select();
+			}},
 		{ name: 'Background',
 			command: 'Background(file)',
-			desc: 'Play a file in the background.',
-			editCancel: function (e) {
+			desc: 'This application will play the given list of files (do not put extension) while waiting for an extension to be dialed by the calling channel. To continue waiting for digits after this application has finished playing files, the WaitExten application should be used. If one of the requested sound files does not exist, call processing will be terminated.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
 			},
 			editSave: function (e) {
 				$(e.target).parents('.edit').hide();
@@ -351,46 +377,282 @@
 			}},
 		{ name: 'Busy',
 			command: 'Busy()',
-			desc: 'Runs the Busy() command.', },
+			desc: 'This application will indicate the busy condition to the calling channel. This application will wait until the calling channel hangs up.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}},
 		{ name: 'Congestion',
 			command: 'Congestion()',
-			desc: 'Runs the Congestion() command.', },
+			desc: 'This application will indicate the congestion condition to the calling channel. This application will wait until the calling channel hangs up.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}},
 		{ name: 'DigitTimeout',
-			command: 'DigitTimeout()',
-			desc: 'Runs the DigitTimeout() command.', },
+			command: 'Set(TIMEOUT(digit)=5)',
+			desc: 'This sets the TIMEOUT(digit) variable to a non-zero integer. The TIMEOUT(digit) variable is the maximum number of seconds a users has to type additional digits before timing out. The default value is 5 seconds.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var digit  = $(e.target).parents('.edit').find('input.digit').attr('value');
+				var command = "Set(TIMEOUT(digit)="+digit+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('digit').attr('value','5'));
+				form.prepend($("<span></span>").html('Please insert a new timeout (integer) value: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.digit').focus().select();
+			}},
 		{ name: 'DISA',
-			command: 'DISA()',
-			desc: 'Runs the DISA() command.', },
+			command: 'DISA(123)',
+			desc: '	The DISA, Direct Inward System Access, application allows someone from outside the telephone switch (PBX) to obtain an "internal" system dialtone and to place calls from it as if they were placing a call from within the switch.\
+	DISA plays a dialtone. The user enters their numeric passcode, followed by the pound sign (#). If the passcode is correct, the user is then given system dialtone on which a call may be placed. Obviously, this type of access has SERIOUS security implcations, and GREAT care must be taken NOT to compromise your security.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var pwd  = $(e.target).parents('.edit').find('input.pwd').attr('value');
+				var command = "DISA("+pwd+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('pwd').attr('value','123'));
+				form.prepend($("<span></span>").html('Please insert the passcode or file containing passcodes: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.pwd').focus().select();
+			}},
 		{ name: 'ResponseTimeout',
-			command: 'ResponseTimeout()',
-			desc: 'Runs the ResponseTimeout() command.', },
+			command: 'Set(TIMEOUT(response)=5)',
+			desc: 'This sets the TIMEOUT(response) variable to a non-zero integer. The TIMEOUT(response) variable is the maximum number of seconds a users has to type additional digits before timing out. The default value is 5 seconds.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var digit  = $(e.target).parents('.edit').find('input.response').attr('value');
+				var command = "Set(TIMEOUT(response)="+digit+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('response').attr('value','5'));
+				form.prepend($("<span></span>").html('Please insert a new timeout (integer) value: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.response').focus().select();
+			}},
 		{ name: 'Macro',
-			command: 'Macro()',
-			desc: 'Runs the Macro() command.', },
+			command: 'Macro(stdexten)',
+			desc: 'Executes a macro using the context \'macro-<macroname>\', jumping to the \'s\' extension of that context and executing each step, then returning when the steps end.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var name  = $(e.target).parents('.edit').find('input.macro').attr('value');
+				var command = "Macro("+name+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('macro').attr('value','stdexten'));
+				form.prepend($("<span></span>").html('Please insert the name of the macro: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.macro').focus().select();
+			}},
 		{ name: 'Playback',
-			command: 'Playback()',
-			desc: 'Runs the Playback() command.', },
+			command: 'Playback(file)',
+			desc: 'Plays back given filenames (do not put extensions).',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var file  = $(e.target).parents('.edit').find('input.file').attr('value');
+				var command = "Playback("+file+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('file').attr('value','file'));
+				form.prepend($("<span></span>").html('Please insert the file you wish to play: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.file').focus().select();
+			}},
 		{ name: 'Ringing',
 			command: 'Ringing()',
-			desc: 'Runs the Ringing() command.', },
+			desc: 'This application will request that the channel indicate a ringing tone to the user.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}},
 		{ name: 'SetMusicOnHold',
-			command: 'SetMusicOnHold()',
-			desc: 'Runs the SetMusicOnHold() command.', },
+			command: 'SetMusicOnHold(default)',
+			desc: 'Sets the default class for music on hold for a given channel. When music on hold is activated, this class will be used to select which music is played.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var music  = $(e.target).parents('.edit').find('input.music').attr('value');
+				var command = "SetMusicOnHold("+music+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('music').attr('value','default'));
+				form.prepend($("<span></span>").html('Please insert the music class you\'d like to use: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.music').focus().select();
+			}},
 		{ name: 'SayAlpha',
-			command: 'SayAlpha()',
-			desc: 'Runs the SayAlpha() command.', },
+			command: 'SayAlpha(string)',
+			desc: 'This application will play the sounds that correspond to the letters of the given string.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var alpha  = $(e.target).parents('.edit').find('input.alpha').attr('value');
+				var command = "SayAlpha("+alpha+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('alpha').attr('value','abc'));
+				form.prepend($("<span></span>").html('Please insert the letters you wish to say: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.alpha').focus().select();
+			}},
 		{ name: 'SayDigits',
-			command: 'SayDigits()',
-			desc: 'Runs the SayDigits() command.', },
+			command: 'SayDigits(1234)',
+			desc: 'This application will play the sounds that correspond to the digits of the given number.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var digits  = $(e.target).parents('.edit').find('input.digits').attr('value');
+				var command = "SayDigits("+digits+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('digits').attr('value','1234'));
+				form.prepend($("<span></span>").html('Please insert the file you wish to play: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.digits').focus().select();
+			}},
 		{ name: 'SayNumber',
-			command: 'SayNumber()',
-			desc: 'Runs the SayNumber() command.', },
+			command: 'SayNumber(1234[,gender])',
+			desc: 'This application will play the sounds that correspond to the given number. Optionally, a gender may be specified.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var digits  = $(e.target).parents('.edit').find('input.digits').attr('value');
+				var gender  = $(e.target).parents('.edit').find(':input.gender').attr('value');
+				var command = "SayNumber("+digits+(gender!="default"?","+gender+"":"")+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<select></select>").addClass('gender')
+					.append($("<option></option>").attr("value","default").html("Default"))
+					.append($("<option></option>").attr("value","female").html("Female"))
+					.append($("<option></option>").attr("value","male").html("Male")));
+				form.prepend($("<span></span>").html('Please select a gender: '));
+				form.prepend("<br />");
+
+				form.prepend($("<input/>").addClass('digits').attr('value','1024'));
+				form.prepend($("<span></span>").html('Please insert the number: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.digits').focus().select();
+			}},
 		{ name: 'Wait',
 			command: 'Wait()',
-			desc: 'Runs the Wait() command.', },
+			desc: 'This application waits for a specified number of seconds. Then, dialplan execution will continue at the next priority. Note that the seconds can be passed with fractions of a second. For example, \'1.5\' will ask the application to wait for 1.5 seconds.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var seconds  = $(e.target).parents('.edit').find('input.seconds').attr('value');
+				var command = "Wait("+seconds+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('seconds').attr('value','1'));
+				form.prepend($("<span></span>").html('Please insert the number of seconds you wish to wait: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.seconds').focus().select();
+			}},
 		{ name: 'WaitExten',
-			command: 'WaitExten()',
-			desc: 'Runs the WaitExten() command.', },
+			command: 'WaitExten(5)',
+			desc: 'This application waits for the user to enter a new extension for a specified number of seconds. Note that the seconds can be passed with fractions of a second. For example, \'1.5\' will ask the application to wait for 1.5 seconds.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var seconds  = $(e.target).parents('.edit').find('input.seconds').attr('value');
+				var command = "WaitExten("+seconds+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('seconds').attr('value','1'));
+				form.prepend($("<span></span>").html('Please insert the number of seconds you wish to wait: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.seconds').focus().select();
+			}},
 		{ name: 'toDestination',
 			command: 'toDestination()',
 			desc: 'Runs the toDestination() command.', },
@@ -398,26 +660,104 @@
 			command: 'toDestinationByCallerId()',
 			desc: 'Runs the toDestinationByCallerId() command.', },
 		{ name: 'setLanguage',
-			command: 'setLanguage()',
-			desc: 'Runs the setLanguage() command.', },
-		{ name: 'GotoDirecotry',
-			command: 'GotoDirecotry()',
-			desc: 'Runs the GotoDirecotry() command.', },
+			command: 'set(CHANNEL(language)=en)',
+			desc: 'Runs the setLanguage() command.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var lang  = $(e.target).parents('.edit').find(':input.lang').attr('value');
+				var command = "Set(CHANNEL(language)="+lang+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<select></select>").addClass('lang')
+					.append($("<option></option>").attr("value","en").html("English"))
+					.append($("<option></option>").attr("value","es").html("Spanish"))
+					.append($("<option></option>").attr("value","fr").html("French")));
+				form.prepend($("<span></span>").html('Please select the language you wish to use: '));
+				help.html(this.desc);
+				$(ele).show();
+			}},
+		{ name: 'GotoDirectory',
+			command: 'Directory(default)',
+			desc: 'Runs the GotoDirectory() command.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}},
 		{ name: 'DialViaTrunk',
 			command: 'DialViaTrunk()',
-			desc: 'Runs the DialViaTrunk() command.', },
+			desc: 'Runs the DialViaTrunk() command.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}},
 		{ name: 'AGI',
-			command: 'AGI()',
-			desc: 'Runs the AGI() command.', },
+			command: 'AGI(test.agi)',
+			desc: 'Executes an Asterisk Gateway Interface compliant program on a channel. AGI allows Asterisk to launch external programs written in any language to control a telephony channel, play audio, read DTMF digits, etc. by communicating with the AGI protocol on stdin and stdout. This channel will stop dialplan execution on hangup inside of this application. Otherwise, dialplan execution will continue normally.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var file  = $(e.target).parents('.edit').find(':input.file').attr('value');
+				var command = "Agi("+file+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('file').attr('value','test.agi'));
+				form.prepend($("<span></span>").html('Please insert the AGI script you wish to run: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.file').focus().select();
+			}},
 		{ name: 'UserEvent',
-			command: 'UserEvent()',
-			desc: 'Runs the UserEvent() command.', },
-		{ name: 'CheckOwnVoiceMail',
-			command: 'CheckOwnVoiceMail()',
-			desc: 'Runs the CheckOwnVoiceMail() command.', },
+			command: 'UserEvent(eventname[|body])',
+			desc: 'Sends an arbitrary event to the manager interface, with an optional body representing additional arguments. The body may be specified as a | delimited list of headers. Each additional argument will be placed on a new line in the event. If no body is specified, only Event and UserEvent headers will be present.',
+			editCancel: function (e) {
+				$(e.target).parents('.edit').hide();
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var eventname  = $(e.target).parents('.edit').find(':input.eventname').attr('value');
+				var eventbody  = $(e.target).parents('.edit').find(':input.eventbody').attr('value');
+				var command = "UserEvent("+eventname+(eventbody?"|"+eventbody+"":"")+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('eventbody').attr('value','Var: value'));
+				form.prepend($("<span></span>").html('Please insert your event\'s body: '));
+				form.prepend($("<br />"));
+				form.prepend($("<input/>").addClass('eventname').attr('value','UserEvent'));
+				form.prepend($("<span></span>").html('Please insert the UserEvent name: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.file').focus().select();
+			}},
 		{ name: 'Hangup',
 			command: 'Hangup()',
-			desc: 'Runs the Hangup() command.', }
+			desc: 'Runs the Hangup() command.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+			},
+			editShow: function (ele) {
+			}}
 	);
 
 	$(document).ready( function() {




More information about the asterisk-gui-commits mailing list