128 struct timeval when = {0,};
142 res = sscanf(
value,
"%30ld%30lf", &sec, &x);
143 if (res == 0 || sec < 0) {
146 }
else if (res == 1) {
148 }
else if (res == 2) {
150 when.tv_usec = x * 1000000;
162 ast_strftime(timestr,
sizeof(timestr),
"%Y-%m-%d %H:%M:%S.%3q %Z",
164 ast_verb(3,
"Channel will hangup at %s.\n", timestr);
166 ast_verb(3,
"Channel hangup cancelled.\n");
Asterisk main include file. File version handling, generic pbx functions.
General Asterisk PBX channel definitions.
#define ast_channel_lock(chan)
struct timeval * ast_channel_whentohangup(struct ast_channel *chan)
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hang a channel up.
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int timeout_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int timeout_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static struct ast_custom_function timeout_function
static int load_module(void)
static int unload_module(void)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define VERBOSITY_ATLEAST(level)
#define ast_verb(level,...)
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Core PBX routines and definitions.
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().