102 snprintf(buf, len,
"%.3f",
ast_channel_pbx(chan)->rtimeoutms / 1000.0);
109 snprintf(buf, len,
"%.3f",
ast_channel_pbx(chan)->dtimeoutms / 1000.0);
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");
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hang a channel up.
#define VERBOSITY_ATLEAST(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_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
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.
static int timeout_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
#define ast_verb(level,...)
static struct ast_custom_function timeout_function
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
struct timeval * ast_channel_whentohangup(struct ast_channel *chan)
General Asterisk PBX channel definitions.
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
Data structure associated with a custom dialplan function.
static int timeout_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Core PBX routines and definitions.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
static int unload_module(void)
#define ast_channel_unlock(chan)
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...
static int load_module(void)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.