From d9276a9c5efaa50a22cc811014a96d33c4db204b Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 30 Aug 2010 22:18:20 +0000 Subject: [PATCH] Merged revisions 1845 via svnmerge from https://origsvn.digium.com/svn/libpri/branches/1.4 ........ r1845 | rmudgett | 2010-08-03 12:33:54 -0500 (Tue, 03 Aug 2010) | 10 lines 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/tags/1.4.11.4@1941 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;