aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 19:21:53 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 19:21:53 +0000
commitc15217e47d4999376746fce96bbc01ff9cc25918 (patch)
tree7931da627d66b823617a246e92c8b4ed2a5d896a /funcs
parent035cc6c42ee674083f2e44ca54f70440c4e64e4c (diff)
Fix func_timeout to take values in floating point so 1.5 actually means
1.5 seconds instead of being rounded. (closes issue #10540, reported by spendergrass, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80539 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-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 7d9d535ea..37b441127 100644
--- a/funcs/func_timeout.c
+++ b/funcs/func_timeout.c
@@ -89,6 +89,7 @@ static int timeout_read(struct ast_channel *chan, char *cmd, char *data,
static int timeout_write(struct ast_channel *chan, char *cmd, char *data,
const char *value)
{
+ float f;
int x;
char timestr[64];
struct tm myt;
@@ -104,7 +105,10 @@ static int timeout_write(struct ast_channel *chan, 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':