From 3ab48f929936a3eb40b6f00fa6c3d2446fe3b772 Mon Sep 17 00:00:00 2001 From: Brett Bryant Date: Wed, 28 May 2008 16:10:48 +0000 Subject: [PATCH] merge revision 118702 from trunk to 1.4 -- Fixes a bug in chan_iax that uses send_command to poke a peer while a channel is unlocked in some cases, and because it can cause seemingly random failures could be related to some bugs in the tracker... git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118716 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_iax2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 67bfff42ca..4391777712 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8878,7 +8878,11 @@ static int iax2_poke_peer(struct iax2_peer *peer, int heldcall) peer_unref(peer); /* And send the poke */ - send_command(iaxs[peer->callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1); + ast_mutex_lock(&iaxsl[peer->callno]); + if (iaxs[peer->callno]) { + send_command(iaxs[peer->callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1); + } + ast_mutex_unlock(&iaxsl[peer->callno]); return 0; }