diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-10 15:37:07 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-10 15:37:07 +0000 |
commit | 0c8b6d125e87ef3c303b604d8878cfb0e0d60fe9 (patch) | |
tree | af8b77f9760396fc5b169d10c49452d8d4ee5dc9 /channels | |
parent | e87af7e92f95c2ec8b7b6863b619bbd45af35209 (diff) |
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/trunk@174543 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-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 bfec672aa..8d2b8ba75 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5230,9 +5230,11 @@ static int update_call_counter(struct sip_pvt *fup, int event) if (inuse) { sip_pvt_lock(fup); ao2_lock(p); - 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; } @@ -5244,9 +5246,11 @@ static int update_call_counter(struct sip_pvt *fup, int event) if (inringing) { sip_pvt_lock(fup); ao2_lock(p); - 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; } |