From 9d1fa7f27620f53c4f2b106964d58778742ce0b7 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 6 Aug 2010 18:22:39 +0000 Subject: [PATCH] Learn (AGAIN!) why state 7 and state 8 transitions were suppressed. git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1852 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q921.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/q921.c b/q921.c index d4552b3..66a4f58 100644 --- a/q921.c +++ b/q921.c @@ -97,6 +97,29 @@ static const char *q921_state2str(enum q921_state state) static void q921_setstate(struct pri *ctrl, int newstate) { if (ctrl->debug & PRI_DEBUG_Q921_STATE) { + /* + * Suppress displaying these state transitions: + * Q921_MULTI_FRAME_ESTABLISHED <--> Q921_TIMER_RECOVERY + * + * Q921 keeps flipping back and forth between these two states + * when it has nothing better to do. + */ + switch (ctrl->q921_state) { + case Q921_MULTI_FRAME_ESTABLISHED: + case Q921_TIMER_RECOVERY: + switch (newstate) { + case Q921_MULTI_FRAME_ESTABLISHED: + case Q921_TIMER_RECOVERY: + /* Suppress displaying this state transition. */ + ctrl->q921_state = newstate; + return; + default: + break; + } + break; + default: + break; + } if (ctrl->q921_state != newstate) { pri_message(ctrl, "Changing from state %d(%s) to %d(%s)\n", ctrl->q921_state, q921_state2str(ctrl->q921_state),