diff --git a/channels/chan_sip.c b/channels/chan_sip.c index abe3785534..014ab271a7 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; }