diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-10 21:19:33 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-10 21:19:33 +0000 |
commit | 1d08c61d23d6592721b53a0bf74caa243a09e51c (patch) | |
tree | f45e4307734ebe3281ef03aa0c3b735dc82ec1c1 /channels | |
parent | 9286d00391831c534eca39cbb618f313dd32308b (diff) |
Merged revisions 148373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r148373 | mmichelson | 2008-10-10 16:18:10 -0500 (Fri, 10 Oct 2008) | 8 lines
Make sure that the inUse and inRinging fields for
a sip peer cannot go below zero. This is a regression
from 1.4 and so it will be applied to 1.6.0 as well.
(closes issue #13668)
Reported by: mjc
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@148375 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 52d6bb469..257f0f8b5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4691,13 +4691,13 @@ static int update_call_counter(struct sip_pvt *fup, int event) /* incoming and outgoing affects the inUse counter */ case DEC_CALL_LIMIT: /* Decrement inuse count if applicable */ - if (inuse && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) { + if (inuse && *inuse > 0 && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) { ast_atomic_fetchadd_int(inuse, -1); ast_clear_flag(&fup->flags[0], SIP_INC_COUNT); } else *inuse = 0; /* Decrement ringing count if applicable */ - if (inringing && ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) { + if (inringing && *inringing > 0 && ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) { ast_atomic_fetchadd_int(inringing, -1); ast_clear_flag(&fup->flags[0], SIP_INC_RINGING); } @@ -4735,7 +4735,7 @@ static int update_call_counter(struct sip_pvt *fup, int event) break; case DEC_CALL_RINGING: - if (inringing && ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) { + if (inringing && *inringing > 0 && ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) { ast_atomic_fetchadd_int(inringing, -1); ast_clear_flag(&fup->flags[0], SIP_INC_RINGING); } |