summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-05-01 23:06:23 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-05-01 23:06:23 +0000
commitb5a127daac81d625b5968068b2e0406a3dc2e0e9 (patch)
tree3df7d1e791a878179b45272be0b3f3cccf8eeee0 /apps/app_dial.c
parent44af1e23d05a2b9005a4be408978a2263bf7f1a7 (diff)
Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540) Reported by: spendergrass Patches: 20080417__bug10540.diff.txt uploaded by Corydon76 (license 14) Tested by: blitzrage git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 5730d99d7..d72a85411 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1472,7 +1472,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
tc->appl = "AppDial";
tc->data = "(Outgoing Line)";
- tc->whentohangup = 0;
+ memset(&tc->whentohangup, 0, sizeof(tc->whentohangup));
S_REPLACE(tc->cid.cid_num, ast_strdup(chan->cid.cid_num));
S_REPLACE(tc->cid.cid_name, ast_strdup(chan->cid.cid_name));
@@ -1839,7 +1839,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (!res) {
if (calldurationlimit > 0) {
- peer->whentohangup = time(NULL) + calldurationlimit;
+ struct timeval whentohangup = { calldurationlimit, 0 };
+ peer->whentohangup = ast_tvadd(ast_tvnow(), whentohangup);
}
if (!ast_strlen_zero(dtmfcalled)) {
ast_verb(3, "Sending DTMF '%s' to the called party.\n", dtmfcalled);
@@ -1967,7 +1968,7 @@ out:
if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_KEEPALIVE) && (res != AST_PBX_INCOMPLETE)) {
if (calldurationlimit)
- chan->whentohangup = 0;
+ memset(&chan->whentohangup, 0, sizeof(chan->whentohangup));
res = 0;
}