[Asterisk-cvs] asterisk/channels chan_zap.c,1.145,1.146

markster at lists.digium.com markster at lists.digium.com
Mon Dec 1 17:33:04 CST 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv2233/channels

Modified Files:
	chan_zap.c 
Log Message:
Fix chanzap for p0, p1, etc


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- chan_zap.c	23 Nov 2003 23:13:27 -0000	1.145
+++ chan_zap.c	1 Dec 2003 23:59:28 -0000	1.146
@@ -2226,13 +2226,19 @@
 	/* if need DTMF, cant native bridge */
 	if (flags & (AST_BRIDGE_DTMF_CHANNEL_0 | AST_BRIDGE_DTMF_CHANNEL_1))
 		return -2;
-	p0 = c0->pvt->pvt;
-	p1 = c1->pvt->pvt;
-	/* cant do pseudo-channels here */
-	if ((!p0->sig) || (!p1->sig)) return -2;
 		
 	ast_mutex_lock(&c0->lock);
 	ast_mutex_lock(&c1->lock);
+
+	p0 = c0->pvt->pvt;
+	p1 = c1->pvt->pvt;
+	/* cant do pseudo-channels here */
+	if (!p0 || (!p0->sig) || !p1 || (!p1->sig)) {
+		ast_mutex_unlock(&c0->lock);
+		ast_mutex_unlock(&c1->lock);
+		return -2;
+	}
+
 	op0 = p0 = c0->pvt->pvt;
 	op1 = p1 = c1->pvt->pvt;
 	ofd1 = c0->fds[0];




More information about the svn-commits mailing list