summaryrefslogtreecommitdiff
path: root/funcs/func_timeout.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_timeout.c')
-rw-r--r--funcs/func_timeout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c
index 86186ba24..3f510e4b0 100644
--- a/funcs/func_timeout.c
+++ b/funcs/func_timeout.c
@@ -90,6 +90,7 @@ static int timeout_read(struct ast_channel *chan, const char *cmd, char *data,
static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
const char *value)
{
+ float f;
int x;
char timestr[64];
struct ast_tm myt;
@@ -105,7 +106,10 @@ static int timeout_write(struct ast_channel *chan, const char *cmd, char *data,
if (!value)
return -1;
- x = atoi(value);
+ f = atof(value);
+ if (f < 0)
+ f = 1.0;
+ x = (int) (f * 1000);
switch (*data) {
case 'a':