From 5601f3be43b06363541f585f23ebd8cf29b081c6 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 2 Jan 2013 21:23:16 +0000 Subject: Fix AMI redirect action with two channels failing to redirect both channels. The AMI redirect action can fail to redirect two channels that are bridged together. There is a race between the AMI thread redirecting the two channels and the bridge thread noticing that a channel is hungup from the redirects. * Made the bridge wait for both channels to be redirected before exiting. * Made the AMI redirect check that all required headers are present before proceeding with the redirection. * Made the AMI redirect require that any supplied ExtraChannel exist before proceeding. Previously the code fell back to a single channel redirect operation. (closes issue ASTERISK-18975) Reported by: Ben Klang (closes issue ASTERISK-19948) Reported by: Brent Dalgleish Patches: jira_asterisk_19948_v11.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett, Thomas Sevestre, Deepak Lohani, Kayode Review: https://reviewboard.asterisk.org/r/2243/ ........ Merged revisions 378356 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378358 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378374 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/channel.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/asterisk/channel.h') diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 9b408660b..858657ab0 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -903,12 +903,19 @@ enum { * some non-traditional dialplans (like AGI) to continue to function. */ AST_FLAG_DISABLE_WORKAROUNDS = (1 << 20), - /*! Disable device state event caching. This allows allows channel - * drivers to selectively prevent device state events from being cached - * by certain channels such as anonymous calls which have no persistent - * represenatation that can be tracked. + /*! + * Disable device state event caching. This allows channel + * drivers to selectively prevent device state events from being + * cached by certain channels such as anonymous calls which have + * no persistent represenatation that can be tracked. */ AST_FLAG_DISABLE_DEVSTATE_CACHE = (1 << 21), + /*! + * This flag indicates that a dual channel redirect is in + * progress. The bridge needs to wait until the flag is cleared + * to continue. + */ + AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT = (1 << 22), }; /*! \brief ast_bridge_config flags */ -- cgit v1.2.3