aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_sayunixtime.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
commitb1f91b97d2085cc845d0f57bd9907de50c995105 (patch)
tree9c836ac808552d20be6bd2baa3a3c29f642eda53 /apps/app_sayunixtime.c
parentc5d084051f21e943fcbcc347fc80b166885f298d (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_sayunixtime.c')
-rw-r--r--apps/app_sayunixtime.c69
1 files changed, 47 insertions, 22 deletions
diff --git a/apps/app_sayunixtime.c b/apps/app_sayunixtime.c
index d0e23449e..f6122e40d 100644
--- a/apps/app_sayunixtime.c
+++ b/apps/app_sayunixtime.c
@@ -36,29 +36,54 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/say.h"
#include "asterisk/app.h"
+/*** DOCUMENTATION
+ <application name="SayUnixTime" language="en_US">
+ <synopsis>
+ Says a specified time in a custom format.
+ </synopsis>
+ <syntax>
+ <parameter name="unixtime">
+ <para>time, in seconds since Jan 1, 1970. May be negative. Defaults to now.</para>
+ </parameter>
+ <parameter name="timezone">
+ <para>timezone, see <directory>/usr/share/zoneinfo</directory> for a list. Defaults to machine default.</para>
+ </parameter>
+ <parameter name="format">
+ <para>a format the time is to be said in. See <filename>voicemail.conf</filename>.
+ Defaults to <literal>ABdY "digits/at" IMp</literal></para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>Uses some of the sound files stored in <directory>/var/lib/asterisk/sounds</directory> to construct a phrase
+ saying the specified date and/or time in the specified format. </para>
+ </description>
+ </application>
+ <application name="DateTime" language="en_US">
+ <synopsis>
+ Says a specified time in a custom format.
+ </synopsis>
+ <syntax>
+ <parameter name="unixtime">
+ <para>time, in seconds since Jan 1, 1970. May be negative. Defaults to now.</para>
+ </parameter>
+ <parameter name="timezone">
+ <para>timezone, see <filename>/usr/share/zoneinfo</filename> for a list. Defaults to machine default.</para>
+ </parameter>
+ <parameter name="format">
+ <para>a format the time is to be said in. See <filename>voicemail.conf</filename>.
+ Defaults to <literal>ABdY "digits/at" IMp</literal></para>
+ </parameter>
+ </syntax>
+ <description>
+ <para>Say the date and time in a specified format.</para>
+ </description>
+ </application>
+
+ ***/
+
static char *app_sayunixtime = "SayUnixTime";
static char *app_datetime = "DateTime";
-static char *sayunixtime_synopsis = "Says a specified time in a custom format";
-
-static char *sayunixtime_descrip =
-"SayUnixTime([unixtime][,[timezone][,format]])\n"
-" unixtime - time, in seconds since Jan 1, 1970. May be negative.\n"
-" defaults to now.\n"
-" timezone - timezone, see /usr/share/zoneinfo for a list.\n"
-" defaults to machine default.\n"
-" format - a format the time is to be said in. See voicemail.conf.\n"
-" defaults to \"ABdY 'digits/at' IMp\"\n";
-static char *datetime_descrip =
-"DateTime([unixtime][,[timezone][,format]])\n"
-" unixtime - time, in seconds since Jan 1, 1970. May be negative.\n"
-" defaults to now.\n"
-" timezone - timezone, see /usr/share/zoneinfo for a list.\n"
-" defaults to machine default.\n"
-" format: - a format the time is to be said in. See voicemail.conf.\n"
-" defaults to \"ABdY 'digits/at' IMp\"\n";
-
-
static int sayunixtime_exec(struct ast_channel *chan, void *data)
{
AST_DECLARE_APP_ARGS(args,
@@ -103,8 +128,8 @@ static int load_module(void)
{
int res;
- res = ast_register_application(app_sayunixtime, sayunixtime_exec, sayunixtime_synopsis, sayunixtime_descrip);
- res |= ast_register_application(app_datetime, sayunixtime_exec, sayunixtime_synopsis, datetime_descrip);
+ res = ast_register_application_xml(app_sayunixtime, sayunixtime_exec);
+ res |= ast_register_application_xml(app_datetime, sayunixtime_exec);
return res;
}