From 80c8c46b89e126ca70e259ac6ba903a6168e8419 Mon Sep 17 00:00:00 2001 From: Matthew Fredrickson Date: Wed, 11 Nov 2009 00:22:47 +0000 Subject: [PATCH] Make sure we also revive links for PRIs, not just PTMP TE BRIs when we get a disconnect message git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1291 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- pri_internal.h | 9 +++++++++ q921.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pri_internal.h b/pri_internal.h index 3f496cd..861cbdc 100644 --- a/pri_internal.h +++ b/pri_internal.h @@ -604,6 +604,15 @@ static inline int BRI_TE_PTMP(struct pri *mypri) return pri->bri && (((pri)->localtype == PRI_CPE) && ((pri)->tei == Q921_TEI_GROUP)); } +static inline int PRI_PTP(struct pri *mypri) +{ + struct pri *pri; + + pri = PRI_MASTER(mypri); + + return !pri->bri; +} + #define Q931_DUMMY_CALL_REFERENCE -1 /*! diff --git a/q921.c b/q921.c index c6d9cd0..a653927 100644 --- a/q921.c +++ b/q921.c @@ -1220,8 +1220,8 @@ static pri_event *__q921_receive_qualified(struct pri *pri, q921_h *h, int len) /* Acknowledge */ q921_send_ua(pri, h->u.p_f); ev = q921_dchannel_down(pri); - if (BRI_TE_PTMP(pri)) { - q921_restart(pri, 0); + if (BRI_TE_PTMP(pri) || PRI_PTP(pri)) { + q921_restart(pri, PRI_PTP(pri) ? 1 : 0); } return ev; case 3: