From 8dc94862876b037b3df50c7df54eac67546874f3 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 20 Dec 2010 22:42:07 +0000 Subject: [PATCH] Fix regression when reorganized for struct pri and struct q921_link. git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@2169 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q931.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/q931.c b/q931.c index 20c0d90..086dc46 100644 --- a/q931.c +++ b/q931.c @@ -7426,12 +7426,16 @@ struct q931_call *q931_find_held_active_call(struct pri *ctrl, struct q931_call struct q931_call *winner; struct q931_call *match; + if (!held_call->link) { + /* Held call does not have an active link. */ + return NULL; + } match = NULL; for (cur = *ctrl->callpool; cur; cur = cur->next) { if (cur->hold_state == Q931_HOLD_STATE_IDLE) { /* Found an active call. */ winner = q931_find_winning_call(cur); - if (!winner || (BRI_NT_PTMP(ctrl) && winner->pri != held_call->pri)) { + if (!winner || (BRI_NT_PTMP(ctrl) && winner->link != held_call->link)) { /* There is no winner or the active call does not go to the same TEI. */ continue; } @@ -7478,12 +7482,16 @@ static struct q931_call *q931_find_held_call(struct pri *ctrl, struct q931_call struct q931_call *winner; struct q931_call *match; + if (!active_call->link) { + /* Active call does not have an active link. */ + return NULL; + } match = NULL; for (cur = *ctrl->callpool; cur; cur = cur->next) { if (cur->hold_state == Q931_HOLD_STATE_CALL_HELD) { /* Found a held call. */ winner = q931_find_winning_call(cur); - if (!winner || (BRI_NT_PTMP(ctrl) && winner->pri != active_call->pri)) { + if (!winner || (BRI_NT_PTMP(ctrl) && winner->link != active_call->link)) { /* There is no winner or the held call does not go to the same TEI. */ continue; }