diff options
author | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-04-06 00:10:16 +0000 |
---|---|---|
committer | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-04-06 00:10:16 +0000 |
commit | 064a135a183c99263c36a7f8b121b021c821b344 (patch) | |
tree | 03b3373ad3766c4531e375805b8ed3732b410655 /channels | |
parent | dd2cf60beffbd69c4b900c3b5540bd06e0ab13c8 (diff) |
DAHDI/PRI call to pri_channel_bridge() not protected by PRI lock.
SWP-1231
ABE-2163
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@256225 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index d21ec017f..39e67d361 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -3561,7 +3561,6 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch #ifdef PRI_2BCT int triedtopribridge = 0; - q931_call *q931c0 = NULL, *q931c1 = NULL; #endif /* For now, don't attempt to native bridge if either channel needs DTMF detection. @@ -3777,13 +3776,15 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch } #ifdef PRI_2BCT - q931c0 = p0->call; - q931c1 = p1->call; - if (p0->transfer && p1->transfer - && q931c0 && q931c1 - && !triedtopribridge) { - pri_channel_bridge(q931c0, q931c1); + if (!triedtopribridge) { triedtopribridge = 1; + if (p0->pri && p0->pri == p1->pri && p0->transfer && p1->transfer) { + ast_mutex_lock(&p0->pri->lock); + if (p0->call && p1->call) { + pri_channel_bridge(p0->call, p1->call); + } + ast_mutex_unlock(&p0->pri->lock); + } } #endif |