diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-01 23:06:23 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-01 23:06:23 +0000 |
commit | d1cc29c9c1c324a7421f220482d8cc4f321540ba (patch) | |
tree | 3df7d1e791a878179b45272be0b3f3cccf8eeee0 /apps/app_dial.c | |
parent | 995531248a14d3ac9e88ffc12836176688bb137e (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: http://svn.digium.com/svn/asterisk/trunk@115076 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 7 |
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; } |