summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-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 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;
}