SayUnixTime application. More...
#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/say.h"
#include "asterisk/app.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | load_module (void) |
static int | sayunixtime_exec (struct ast_channel *chan, void *data) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info __MODULE_INFO_SECTION | __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Say time" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } |
static char * | app_datetime = "DateTime" |
static char * | app_sayunixtime = "SayUnixTime" |
static struct ast_module_info * | ast_module_info = &__mod_info |
SayUnixTime application.
Definition in file app_sayunixtime.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 142 of file app_sayunixtime.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 142 of file app_sayunixtime.c.
static int load_module | ( | void | ) | [static] |
Definition at line 132 of file app_sayunixtime.c.
References ast_register_application_xml, and sayunixtime_exec().
{ int res; res = ast_register_application_xml(app_sayunixtime, sayunixtime_exec); res |= ast_register_application_xml(app_datetime, sayunixtime_exec); return res; }
static int sayunixtime_exec | ( | struct ast_channel * | chan, |
void * | data | ||
) | [static] |
Definition at line 92 of file app_sayunixtime.c.
References ast_channel::_state, ast_answer(), AST_APP_ARG, AST_DECLARE_APP_ARGS, AST_DIGIT_ANY, ast_get_time_t(), ast_say_date_with_format, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_strdupa, format, ast_channel::language, and parse().
Referenced by load_module().
{ AST_DECLARE_APP_ARGS(args, AST_APP_ARG(timeval); AST_APP_ARG(timezone); AST_APP_ARG(format); ); char *parse; int res = 0; time_t unixtime; if (!data) return 0; parse = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, parse); ast_get_time_t(args.timeval, &unixtime, time(NULL), NULL); if (chan->_state != AST_STATE_UP) res = ast_answer(chan); if (!res) res = ast_say_date_with_format(chan, unixtime, AST_DIGIT_ANY, chan->language, args.format, args.timezone); return res; }
static int unload_module | ( | void | ) | [static] |
Definition at line 122 of file app_sayunixtime.c.
References ast_unregister_application().
{ int res; res = ast_unregister_application(app_sayunixtime); res |= ast_unregister_application(app_datetime); return res; }
struct ast_module_info __MODULE_INFO_SECTION __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Say time" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 142 of file app_sayunixtime.c.
char* app_datetime = "DateTime" [static] |
Definition at line 90 of file app_sayunixtime.c.
char* app_sayunixtime = "SayUnixTime" [static] |
Definition at line 89 of file app_sayunixtime.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 142 of file app_sayunixtime.c.