diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-11-01 21:10:07 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-11-01 21:10:07 +0000 |
commit | 5b168ee34babe562be856ec8f1dd14c0abd7c1a5 (patch) | |
tree | 9c836ac808552d20be6bd2baa3a3c29f642eda53 /apps/app_sayunixtime.c | |
parent | 1fef0f63bbbde9530837995c8790b839f73b74e7 (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: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_sayunixtime.c')
-rw-r--r-- | apps/app_sayunixtime.c | 69 |
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; } |