Index: q921.c =================================================================== --- q921.c (revision 1444) +++ q921.c (working copy) @@ -247,11 +247,12 @@ } #define restart_t200(pri) reschedule_t200((pri)) +#define restart_t203(pri) reschedule_t203((pri)) -#if 0 +#if 1 static void reschedule_t203(struct pri *pri) { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- Restarting T203 timer\n"); pri_schedule_del(pri, pri->t203_timer); pri->t203_timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T203], t203_expire, pri); @@ -277,11 +278,11 @@ static void start_t203(struct pri *pri) { if (pri->t203_timer) { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "T203 requested to start without stopping first\n"); pri_schedule_del(pri, pri->t203_timer); } - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- Starting T203 timer\n"); pri->t203_timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T203], t203_expire, pri); } @@ -289,12 +290,12 @@ static void stop_t203(struct pri *pri) { if (pri->t203_timer) { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- Stopping T203 timer\n"); pri_schedule_del(pri, pri->t203_timer); pri->t203_timer = 0; } else { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- T203 requested to stop when not started\n"); } } @@ -302,11 +303,11 @@ static void start_t200(struct pri *pri) { if (pri->t200_timer) { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "T200 requested to start without stopping first\n"); pri_schedule_del(pri, pri->t200_timer); } - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- Starting T200 timer\n"); pri->t200_timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T200], t200_expire, pri); } @@ -314,12 +315,12 @@ static void stop_t200(struct pri *pri) { if (pri->t200_timer) { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- Stopping T200 timer\n"); pri_schedule_del(pri, pri->t200_timer); pri->t200_timer = 0; } else { - if (pri->debug & PRI_DEBUG_Q921_DUMP) +// if (pri->debug & PRI_DEBUG_Q921_DUMP) pri_message(pri, "-- T200 requested to stop when not started\n"); } } @@ -1617,8 +1618,13 @@ int res = 0; switch (pri->q921_state) { + case Q921_MULTI_FRAME_ESTABLISHED: + if (!pri->t200_timer) { + reschedule_t203(pri); + } + /* fall through */ + case Q921_TIMER_RECOVERY: - case Q921_MULTI_FRAME_ESTABLISHED: /* FIXME: Verify that it's a command ... */ if (pri->own_rx_busy) { /* XXX: Note: There's a difference in th P/F between both states */ @@ -1662,6 +1668,7 @@ } else { if (pri->q921_state == Q921_TIMER_RECOVERY) { update_v_a(pri, h->i.n_r); + pri_message(pri, "ALEC q921_iframerx res=%d\n", res); break; } else { if (pri->peer_rx_busy) {