aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-10 15:39:53 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-10 15:39:53 +0000
commitb9048a029d9db2c0dd2cafbef6f559342164786b (patch)
tree71d0e67de57fe5573c4f60b4f7e77b31c05e3a6f
parentf286b06842c4c06e6b93430364120e58a0684665 (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.1@174545 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index abe378553..014ab271a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4803,9 +4803,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;
}
@@ -4817,9 +4819,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;
}