From 93d780894810f0460892af0529d9c6f8fe517338 Mon Sep 17 00:00:00 2001 From: jpeeler Date: Mon, 18 Jan 2010 22:31:25 +0000 Subject: 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: http://svn.digium.com/svn/asterisk/trunk@241143 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_dahdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'channels/chan_dahdi.c') diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 2e15b84cf..59e097d42 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -7791,7 +7791,7 @@ winkflashdone: (p->polarity == POLARITY_REV) && ((ast->_state == AST_STATE_UP) || (ast->_state == AST_STATE_RING)) ) { /* Added log_debug information below to provide a better indication of what is going on */ - ast_debug(1, "Polarity Reversal event occured - DEBUG 1: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %d\n", p->channel, ast->_state, p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); + ast_debug(1, "Polarity Reversal event occured - DEBUG 1: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast->_state, p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); if (ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) > p->polarityonanswerdelay) { ast_debug(1, "Polarity Reversal detected and now Hanging up on channel %d\n", p->channel); @@ -7805,7 +7805,7 @@ winkflashdone: ast_debug(1, "Ignoring Polarity switch to IDLE on channel %d, state %d\n", p->channel, ast->_state); } /* Added more log_debug information below to provide a better indication of what is going on */ - ast_debug(1, "Polarity Reversal event occured - DEBUG 2: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %d\n", p->channel, ast->_state, p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); + ast_debug(1, "Polarity Reversal event occured - DEBUG 2: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast->_state, p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); break; default: ast_debug(1, "Dunno what to do with event %d on channel %d\n", res, p->channel); -- cgit v1.2.3