70 static char *app =
"WaitUntil";
72 static int waituntil_exec(
struct ast_channel *chan,
const char *data)
77 struct timeval future = { 0, };
81 if (ast_strlen_zero(data)) {
82 ast_log(LOG_WARNING,
"WaitUntil requires an argument(epoch)\n");
87 if (sscanf(data,
"%30ld%30lf", &seconds, &fraction) == 0) {
88 ast_log(LOG_WARNING,
"WaitUntil called with non-numeric argument\n");
93 future.tv_sec = seconds;
94 future.tv_usec = fraction * 1000000;
97 ast_log(LOG_NOTICE,
"WaitUntil called in the past (now %ld, arg %ld)\n", (
long)now.tv_sec, (
long)future.tv_sec);
110 static int unload_module(
void)
115 static int load_module(
void)
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
int ast_unregister_application(const char *app)
Unregister an application.
General Asterisk PBX channel definitions.
Core PBX routines and definitions.
Support for logging to various files, console and syslog Configuration in file logger.conf.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.