aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 19:22:49 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 19:22:49 +0000
commitf07c6d0fe829cd9ed630dc4876bf34f72ae9d652 (patch)
treefc0d691c5c109604655e05da5c1b72bcfc8bc064
parent027ab8b7a4e25691c8b6a2bf0336215958e8a333 (diff)
Merged revisions 80539 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80539 | russell | 2007-08-23 14:21:53 -0500 (Thu, 23 Aug 2007) | 4 lines 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/trunk@80540 f38db490-d61c-443f-a65b-d21fe96a405b
-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':