diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-10 15:39:00 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-10 15:39:00 +0000 |
commit | 718f41a6685a675629356ed2aa7b1f9d5001a09a (patch) | |
tree | 82af3439f1c2180dd6f7735e0e1f1c12e36a66fc | |
parent | 825a987bebf769b794ca143b3b94e942f3012bde (diff) |
Merged revisions 174543 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r174543 | file | 2009-02-10 11:37:07 -0400 (Tue, 10 Feb 2009) | 6 lines
Make the logic for inuse and inringing manipluation match that of 1.4. The old broken logic would reset the values back to 0 during certain scenarios causing the wrong state to be reported.
(closes issue #14399)
Reported by: caspy
(issue #13238)
Reported by: kowalma
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@174544 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a8264bb30..72d59360c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4556,9 +4556,11 @@ static int update_call_counter(struct sip_pvt *fup, int event) if (inuse) { sip_pvt_lock(fup); ast_mutex_lock(pu_lock); - if ((*inuse > 0) && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) { - (*inuse)--; - ast_clear_flag(&fup->flags[0], SIP_INC_COUNT); + if (*inuse > 0) { + if (ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) { + (*inuse)--; + ast_clear_flag(&fup->flags[0], SIP_INC_COUNT); + } } else { *inuse = 0; } @@ -4570,9 +4572,11 @@ static int update_call_counter(struct sip_pvt *fup, int event) if (inringing) { sip_pvt_lock(fup); ast_mutex_lock(pu_lock); - if ((*inringing > 0)&& ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) { - (*inringing)--; - ast_clear_flag(&fup->flags[0], SIP_INC_RINGING); + if (*inringing > 0) { + if (ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) { + (*inringing)--; + ast_clear_flag(&fup->flags[0], SIP_INC_RINGING); + } } else { *inringing = 0; } |