[asterisk-commits] bweschke: trunk r150887 - in /trunk: CHANGES apps/app_authenticate.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 17 22:35:24 CDT 2008


Author: bweschke
Date: Fri Oct 17 22:35:24 2008
New Revision: 150887

URL: http://svn.digium.com/view/asterisk?view=rev&rev=150887
Log:
 Give app_authenticate the ability to select a prompt other than the default. 

 (closes issue #13734)
 reported and patched by: jvandal


Modified:
    trunk/CHANGES
    trunk/apps/app_authenticate.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=150887&r1=150886&r2=150887
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Fri Oct 17 22:35:24 2008
@@ -28,6 +28,8 @@
 ------------
  * Scheduled meetme conferences may now have their end times extended by
    using MeetMeAdmin.
+ * app_authenticate now gives the ability to select a prompt other than
+   the default.
 
 Miscellaneous
 -------------

Modified: trunk/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_authenticate.c?view=diff&rev=150887&r1=150886&r2=150887
==============================================================================
--- trunk/apps/app_authenticate.c (original)
+++ trunk/apps/app_authenticate.c Fri Oct 17 22:35:24 2008
@@ -58,7 +58,7 @@
 static char *synopsis = "Authenticate a user";
 
 static char *descrip =
-"  Authenticate(password[,options[,maxdigits]]): This application asks the caller\n"
+"  Authenticate(password[,options[,maxdigits[,prompt]]]): This application asks the caller\n"
 "to enter a given password in order to continue dialplan execution. If the password\n"
 "begins with the '/' character, it is interpreted as a file which contains a list of\n"
 "valid passwords, listed 1 password per line in the file.\n"
@@ -76,6 +76,8 @@
 "         maxdigits have been entered (without requiring the user to\n"
 "         press the '#' key).\n"
 "         Defaults to 0 - no limit - wait for the user press the '#' key.\n"
+"     prompt - Override the agent-pass prompt file.\n"
+ ;
 ;
 
 static int auth_exec(struct ast_channel *chan, void *data)
@@ -88,6 +90,7 @@
 		AST_APP_ARG(password);
 		AST_APP_ARG(options);
 		AST_APP_ARG(maxdigits);
+		AST_APP_ARG(prompt);
 	);
 
 	if (ast_strlen_zero(data)) {
@@ -115,6 +118,12 @@
 		maxdigits = sizeof(passwd) - 2;
 	}
 
+	if (!ast_strlen_zero(arglist.prompt)) {
+		prompt = arglist.prompt;
+	} else {
+		prompt = "agent-pass";
+	}
+   
 	/* Start asking for password */
 	for (retries = 0; retries < 3; retries++) {
 		if ((res = ast_app_getdata(chan, prompt, passwd, maxdigits, 0)) < 0)




More information about the asterisk-commits mailing list