More GR-303 fixes, detect drop of D-channel

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@105 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Mark Spencer 2004-06-07 15:55:39 +00:00
parent d0c78dd62d
commit 30d983f45f
2 changed files with 30 additions and 5 deletions

24
q921.c
View File

@ -355,6 +355,23 @@ 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;
@ -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;
}
}

7
q931.c
View File

@ -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)
{
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)