summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2010-01-18 22:31:25 +0000
committerJeff Peeler <jpeeler@digium.com>2010-01-18 22:31:25 +0000
commit568c057c4c03452c86aa70dc4593accee963745f (patch)
tree07b772f4a93f6e959ccf10510fee364dd143f4f6 /include/asterisk
parentbbd290308f67cdaaf3a7cc80b40f09cbe104a112 (diff)
Extend max call limit duration from 24.8 days to 292+ million years.
If the limit was set past MAX_INT upon answering, the call was immediately hung up due to overflow from the return of ast_tvdiff_ms (in ast_check_hangup). The time calculation functions ast_tvdiff_sec and ast_tvdiff_ms have been changed to return an int64_t to prevent overflow. Also the reporter suggested adding a message indicating the reason for the call hanging up. Given that the new limit is so much higher, the message (which would only really be useful in the overflow scenario) has been made a debug message only. (closes issue #16006) Reported by: viraptor git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/time.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asterisk/time.h b/include/asterisk/time.h
index 895d6df50..2ffc691b8 100644
--- a/include/asterisk/time.h
+++ b/include/asterisk/time.h
@@ -43,9 +43,9 @@ typedef typeof(tv.tv_usec) ast_suseconds_t;
* \return the difference in seconds
*/
AST_INLINE_API(
-int ast_tvdiff_sec(struct timeval end, struct timeval start),
+int64_t ast_tvdiff_sec(struct timeval end, struct timeval start),
{
- int result = end.tv_sec - start.tv_sec;
+ int64_t result = end.tv_sec - start.tv_sec;
if (result > 0 && end.tv_usec < start.tv_usec)
result--;
else if (result < 0 && end.tv_usec > start.tv_usec)
@@ -76,7 +76,7 @@ int64_t ast_tvdiff_us(struct timeval end, struct timeval start),
* \return the difference in milliseconds
*/
AST_INLINE_API(
-int ast_tvdiff_ms(struct timeval end, struct timeval start),
+int64_t ast_tvdiff_ms(struct timeval end, struct timeval start),
{
/* the offset by 1,000,000 below is intentional...
it avoids differences in the way that division