summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-06-18 15:24:29 +0000
committerMark Spencer <markster@digium.com>2004-06-18 15:24:29 +0000
commit133120aa385b996b476a92aa37f2bfa33b7af0e4 (patch)
treeb1b1f2b2da5e614d89a3ff6399b76e5dfd417ba7 /channels
parente32c8f1ebed607da7450d233d9afb711bd15fcf9 (diff)
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
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 919a9ab19..26fbb67d8 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) {