aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-06 00:39:44 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-06 00:39:44 +0000
commit769297a208a10bc9a2f53499b5389a048d28bd1c (patch)
tree364c9255a52f153f150cf29dc4e5e2baf01355d3 /channels/chan_dahdi.c
parentdee6d8dbff7d8c26d5d102a5e22aa5a0d130f08e (diff)
Merged revisions 256225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r256225 | rmudgett | 2010-04-05 19:10:16 -0500 (Mon, 05 Apr 2010) | 5 lines 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/trunk@256265 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 72e341ebd..356106e4a 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -6666,25 +6666,31 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
}
#ifdef PRI_2BCT
- switch (p0->sig) {
- case SIG_PRI_LIB_HANDLE_CASES:
- q931c0 = ((struct sig_pri_chan *) (p0->sig_pvt))->call;
- break;
- default:
- q931c0 = NULL;
- break;
- }
- switch (p1->sig) {
- case SIG_PRI_LIB_HANDLE_CASES:
- q931c1 = ((struct sig_pri_chan *) (p1->sig_pvt))->call;
- break;
- default:
- q931c1 = NULL;
- break;
- }
- if (q931c0 && q931c1 && p0->transfer && p1->transfer && !triedtopribridge) {
+ if (!triedtopribridge) {
triedtopribridge = 1;
- pri_channel_bridge(q931c0, q931c1);
+ if (p0->pri && p0->pri == p1->pri && p0->transfer && p1->transfer) {
+ ast_mutex_lock(&p0->pri->lock);
+ switch (p0->sig) {
+ case SIG_PRI_LIB_HANDLE_CASES:
+ q931c0 = ((struct sig_pri_chan *) (p0->sig_pvt))->call;
+ break;
+ default:
+ q931c0 = NULL;
+ break;
+ }
+ switch (p1->sig) {
+ case SIG_PRI_LIB_HANDLE_CASES:
+ q931c1 = ((struct sig_pri_chan *) (p1->sig_pvt))->call;
+ break;
+ default:
+ q931c1 = NULL;
+ break;
+ }
+ if (q931c0 && q931c1) {
+ pri_channel_bridge(q931c0, q931c1);
+ }
+ ast_mutex_unlock(&p0->pri->lock);
+ }
}
#endif