From 82ce0f4efcd6b418b481852be669c2b5ed67a7ce Mon Sep 17 00:00:00 2001
From: David Vossel <dvossel@digium.com>
Date: Thu, 16 Jul 2009 21:45:14 +0000
Subject: [PATCH] TIMEOUT(absolute) returned negative value.

(closes issue #15513)
Reported by: ys



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 funcs/func_timeout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c
index caa5628347..f2623b4857 100644
--- a/funcs/func_timeout.c
+++ b/funcs/func_timeout.c
@@ -90,7 +90,7 @@ static int timeout_read(struct ast_channel *chan, const char *cmd, char *data,
 			ast_copy_string(buf, "0", len);
 		} else {
 			myt = ast_tvnow();
-			snprintf(buf, len, "%.3f", ast_tvdiff_ms(myt, chan->whentohangup) / 1000.0);
+			snprintf(buf, len, "%.3f", ast_tvdiff_ms(chan->whentohangup, myt) / 1000.0);
 		}
 		break;
 
-- 
GitLab