From 92c277dae5e206ae1075ae4e5f1ae63a52cfc627 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 14 Oct 2009 19:03:49 +0000 Subject: [PATCH] In q931_getcall(): Simplify test and add related switch types. git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1205 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q931.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/q931.c b/q931.c index cb89b16..4287c6b 100644 --- a/q931.c +++ b/q931.c @@ -3042,10 +3042,19 @@ static q931_call *q931_getcall(struct pri *ctrl, int cr) prev = NULL; while (cur) { if (cur->cr == cr) { - if (!ctrl->bri && ctrl->switchtype != PRI_SWITCH_GR303_EOC_PATH - && ctrl->switchtype != PRI_SWITCH_GR303_TMC_SWITCHING - && cur->pri != ctrl) { - cur->pri = ctrl; + /* Found existing call. */ + switch (ctrl->switchtype) { + case PRI_SWITCH_GR303_EOC: + case PRI_SWITCH_GR303_EOC_PATH: + case PRI_SWITCH_GR303_TMC: + case PRI_SWITCH_GR303_TMC_SWITCHING: + break; + default: + if (!ctrl->bri) { + /* PRI is set to whoever called us */ + cur->pri = ctrl; + } + break; } return cur; }