--- chan_dahdi.c.alec 2010-11-23 22:16:43.000000000 +1300 +++ chan_dahdi.c 2010-11-23 22:19:36.000000000 +1300 @@ -8835,19 +8835,15 @@ static struct ast_frame *dahdi_read(stru if (idx == SUB_REAL) { /* Ensure the CW timers decrement only on a single subchannel */ if (p->cidcwexpire) { - --p->cidcwexpire; - - /* Expire CID/CW */ - if (p->cidcwexpire == 1) { + if (!(--p->cidcwexpire)) { + /* Expired CID/CW */ ast_verb(3, "CPE does not support Call Waiting Caller*ID.\n"); restore_conference(p); } } if (p->callwaitingrepeat) { - --p->callwaitingrepeat; - - /* Repeat callwaiting tone */ - if (p->callwaitingrepeat == 1) { + if (!(--p->callwaitingrepeat)) { + /* Expired, Repeat callwaiting tone */ ++p->callwaitrings; dahdi_callwait(ast); }