From 5372776ef06bbc185d06b3a02e3ae4342154d196 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 3 Aug 2010 17:33:54 +0000 Subject: [PATCH] Q921_TIMER_RECOVERY SDL issue in q921_rnr_rx() Added missing code specified by Q.921 (Figure B.8 Page 85) when receive RNR in "Timer Recovery" state. (closes issue #16791) Reported by: alecdavis Patches: rnr_timer_recovery.diff.txt uploaded by alecdavis (license 585) git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1845 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q921.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/q921.c b/q921.c index 392d050..d3dbc3a 100644 --- a/q921.c +++ b/q921.c @@ -1781,6 +1781,7 @@ static pri_event *q921_rnr_rx(struct pri *ctrl, q921_h *h) } break; case Q921_TIMER_RECOVERY: + /* Q.921 Figure B.8 Q921 (Sheet 6 of 9) Page 85 */ ctrl->peer_rx_busy = 1; if (is_command(ctrl, h)) { if (h->s.p_f) { @@ -1793,6 +1794,15 @@ static pri_event *q921_rnr_rx(struct pri *ctrl, q921_h *h) q921_setstate(ctrl, Q921_AWAITING_ESTABLISHMENT); break; } + } else { + if (n_r_is_valid(ctrl, h->s.n_r)) { + update_v_a(ctrl, h->s.n_r); + break; + } else { + n_r_error_recovery(ctrl); + q921_setstate(ctrl, Q921_AWAITING_ESTABLISHMENT); + break; + } } } else { if (h->s.p_f) { @@ -1807,6 +1817,15 @@ static pri_event *q921_rnr_rx(struct pri *ctrl, q921_h *h) q921_setstate(ctrl, Q921_AWAITING_ESTABLISHMENT); break; } + } else { + if (n_r_is_valid(ctrl, h->s.n_r)) { + update_v_a(ctrl, h->s.n_r); + break; + } else { + n_r_error_recovery(ctrl); + q921_setstate(ctrl, Q921_AWAITING_ESTABLISHMENT); + break; + } } } break;