diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-01 21:10:07 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-01 21:10:07 +0000 |
commit | b1f91b97d2085cc845d0f57bd9907de50c995105 (patch) | |
tree | 9c836ac808552d20be6bd2baa3a3c29f642eda53 /apps/app_authenticate.c | |
parent | c5d084051f21e943fcbcc347fc80b166885f298d (diff) |
Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format. Currently, a new format is available for
applications and dialplan functions. A good number of conversions to the new format
are also included.
For more information, see the following message to asterisk-dev:
http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@153365 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_authenticate.c')
-rw-r--r-- | apps/app_authenticate.c | 73 |
1 files changed, 47 insertions, 26 deletions
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c index 1bdc1153b..10d0b2f73 100644 --- a/apps/app_authenticate.c +++ b/apps/app_authenticate.c @@ -54,31 +54,52 @@ AST_APP_OPTIONS(auth_app_options, { static char *app = "Authenticate"; - -static char *synopsis = "Authenticate a user"; - -static char *descrip = -" 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" -" When using a database key, the value associated with the key can be anything.\n" -"Users have three attempts to authenticate before the channel is hung up.\n" -" Options:\n" -" a - Set the channels' account code to the password that is entered\n" -" d - Interpret the given path as database key, not a literal file\n" -" m - Interpret the given path as a file which contains a list of account\n" -" codes and password hashes delimited with ':', listed one per line in\n" -" the file. When one of the passwords is matched, the channel will have\n" -" its account code set to the corresponding account code in the file.\n" -" r - Remove the database key upon successful entry (valid with 'd' only)\n" -" maxdigits - maximum acceptable number of digits. Stops reading after\n" -" 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" - ; -; +/*** DOCUMENTATION + <application name="Authenticate" language="en_US"> + <synopsis> + Authenticate a user + </synopsis> + <syntax> + <parameter name="password" required="true"> + <para>Password the user should know</para> + </parameter> + <parameter name="options" required="false"> + <optionlist> + <option name="a"> + <para>Set the channels' account code to the password that is entered</para> + </option> + <option name="d"> + <para>Interpret the given path as database key, not a literal file</para> + </option> + <option name="m"> + <para>Interpret the given path as a file which contains a list of account + codes and password hashes delimited with <literal>:</literal>, listed one per line in + the file. When one of the passwords is matched, the channel will have + its account code set to the corresponding account code in the file.</para> + </option> + <option name="r"> + <para>Remove the database key upon successful entry (valid with <literal>d</literal> only)</para> + </option> + </optionlist> + </parameter> + <parameter name="maxdigits" required="false"> + <para>maximum acceptable number of digits. Stops reading after + maxdigits have been entered (without requiring the user to press the <literal>#</literal> key). + Defaults to 0 - no limit - wait for the user press the <literal>#</literal> key.</para> + </parameter> + <parameter name="prompt" required="false"> + <para>Override the agent-pass prompt file.</para> + </parameter> + </syntax> + <description> + <para>This application asks the caller to enter a given password in order to continue dialplan execution.</para> + <para>If the password begins with the <literal>/</literal> character, + it is interpreted as a file which contains a list of valid passwords, listed 1 password per line in the file.</para> + <para>When using a database key, the value associated with the key can be anything.</para> + <para>Users have three attempts to authenticate before the channel is hung up.</para> + </description> + </application> + ***/ static int auth_exec(struct ast_channel *chan, void *data) { @@ -225,7 +246,7 @@ static int unload_module(void) static int load_module(void) { - if (ast_register_application(app, auth_exec, synopsis, descrip)) + if (ast_register_application_xml(app, auth_exec)) return AST_MODULE_LOAD_FAILURE; return AST_MODULE_LOAD_SUCCESS; } |