|
|
@ -48,6 +48,7 @@ static int waituntil_exec(struct ast_channel *chan, void *data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
int res;
|
|
|
|
double fraction;
|
|
|
|
double fraction;
|
|
|
|
|
|
|
|
long seconds;
|
|
|
|
struct timeval future = { 0, };
|
|
|
|
struct timeval future = { 0, };
|
|
|
|
struct timeval tv = ast_tvnow();
|
|
|
|
struct timeval tv = ast_tvnow();
|
|
|
|
int msec;
|
|
|
|
int msec;
|
|
|
@ -58,12 +59,13 @@ static int waituntil_exec(struct ast_channel *chan, void *data)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (sscanf(data, "%30ld%30lf", (long *)&future.tv_sec, &fraction) == 0) {
|
|
|
|
if (sscanf(data, "%30ld%30lf", &seconds, &fraction) == 0) {
|
|
|
|
ast_log(LOG_WARNING, "WaitUntil called with non-numeric argument\n");
|
|
|
|
ast_log(LOG_WARNING, "WaitUntil called with non-numeric argument\n");
|
|
|
|
pbx_builtin_setvar_helper(chan, "WAITUNTILSTATUS", "FAILURE");
|
|
|
|
pbx_builtin_setvar_helper(chan, "WAITUNTILSTATUS", "FAILURE");
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
future.tv_sec = seconds;
|
|
|
|
future.tv_usec = fraction * 1000000;
|
|
|
|
future.tv_usec = fraction * 1000000;
|
|
|
|
|
|
|
|
|
|
|
|
if ((msec = ast_tvdiff_ms(future, tv)) < 0) {
|
|
|
|
if ((msec = ast_tvdiff_ms(future, tv)) < 0) {
|
|
|
|