130 struct timeval when = {0,};
144 res = sscanf(
value,
"%30ld%30lf", &sec, &x);
145 if (res == 0 || sec < 0) {
148 }
else if (res == 1) {
150 }
else if (res == 2) {
152 when.tv_usec = x * 1000000;
162 ast_strftime(timestr,
sizeof(timestr),
"%Y-%m-%d %H:%M:%S.%3q %Z",
164 ast_verbose(
"Channel will hangup at %s.\n", timestr);
174 chan->
pbx->
rtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000;
182 chan->
pbx->
dtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000;
void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval offset)
Set when to hang a channel up.
void ast_verbose(const char *fmt,...)
#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().
#define ast_verb(level,...)
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
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...
struct timeval whentohangup