diff --git a/q921.c b/q921.c index 8c676b0..f7c1ee6 100755 --- a/q921.c +++ b/q921.c @@ -355,9 +355,26 @@ static void t200_expire(void *vpri) q921_start(pri, 1); pri->schedev = 1; } + } else if (pri->solicitfbit) { + if (pri->debug & PRI_DEBUG_Q921_STATE) + pri_message("-- Retrying poll with f-bit\n"); + pri->retrans++; + if (pri->retrans < N_200) { + pri->solicitfbit = 1; + q921_rr(pri, 1, 1); + pri->t200_timer = pri_schedule_event(pri, T_200, t200_expire, pri); + } else { + if (pri->debug & PRI_DEBUG_Q921_STATE) + pri_message("-- Timeout occured, restarting PRI\n"); + pri->q921_state = Q921_LINK_CONNECTION_RELEASED; + pri->t200_timer = 0; + q921_dchannel_down(pri); + q921_start(pri, 1); + pri->schedev = 1; + } } else { pri_error("T200 counter expired, nothing to send...\n"); - pri->t200_timer = 0; + pri->t200_timer = 0; } } @@ -439,12 +456,13 @@ static void t203_expire(void *vpri) pri_message("T203 counter expired, sending RR and scheduling T203 again\n"); /* Solicit an F-bit in the other's RR */ pri->solicitfbit = 1; + pri->retrans = 0; q921_rr(pri, 1, 1); - /* Restart ourselves */ - pri->t203_timer = pri_schedule_event(pri, T_203, t203_expire, pri); + /* Start timer T200 to resend our RR if we don't get it */ + pri->t203_timer = pri_schedule_event(pri, T_200, t200_expire, pri); } else { if (pri->debug & PRI_DEBUG_Q921_STATE) - pri_message("T203 counter expired in weird statd %d\n", pri->q921_state); + pri_message("T203 counter expired in weird state %d\n", pri->q921_state); pri->t203_timer = 0; } } diff --git a/q931.c b/q931.c index 8c8b12a..86bd52a 100755 --- a/q931.c +++ b/q931.c @@ -1923,9 +1923,16 @@ static int q931_release_complete(struct pri *pri, q931_call *c, int cause) static int connect_acknowledge_ies[] = { -1 }; +static int gr303_connect_acknowledge_ies[] = { Q931_CHANNEL_IDENT, -1 }; + static int q931_connect_acknowledge(struct pri *pri, q931_call *c) { - return send_message(pri, c, Q931_CONNECT_ACKNOWLEDGE, connect_acknowledge_ies); + if (pri->subchannel) { + if (pri->localtype == PRI_CPE) + return send_message(pri, c, Q931_CONNECT_ACKNOWLEDGE, gr303_connect_acknowledge_ies); + } else + return send_message(pri, c, Q931_CONNECT_ACKNOWLEDGE, connect_acknowledge_ies); + return 0; } int q931_hangup(struct pri *pri, q931_call *c, int cause)