From: Mark Spencer Date: Fri, 18 Jun 2004 15:24:29 +0000 (+0000) Subject: Be sure we hold channel lock in write before talking to PRI channel X-Git-Tag: 1.0.0-rc1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=133120aa385b996b476a92aa37f2bfa33b7af0e4;p=thirdparty%2Fasterisk.git Be sure we hold channel lock in write before talking to PRI channel git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3241 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 919a9ab195..26fbb67d80 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -3994,7 +3994,6 @@ static int zt_write(struct ast_channel *ast, struct ast_frame *frame) int res; unsigned char outbuf[4096]; int index; - index = zt_get_index(ast, p, 0); if (index < 0) { ast_log(LOG_WARNING, "%s doesn't really exist?\n", ast->name); @@ -4002,6 +4001,7 @@ static int zt_write(struct ast_channel *ast, struct ast_frame *frame) } #ifdef ZAPATA_PRI + ast_mutex_lock(&p->lock); if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) { if (p->pri->pri) { if (!pri_grab(p, p->pri)) { @@ -4012,6 +4012,7 @@ static int zt_write(struct ast_channel *ast, struct ast_frame *frame) } p->proceeding=1; } + ast_mutex_unlock(&p->lock); #endif /* Write a frame of (presumably voice) data */ if (frame->frametype != AST_FRAME_VOICE) {