From: Sean Bright Date: Wed, 1 Feb 2012 15:50:50 +0000 (+0000) Subject: Resolve an overlap in the ast_audiohook_flags values. X-Git-Tag: 1.8.11.0-rc1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f28f00bd6e3caa5f8572501b8f692068e9e09259;p=thirdparty%2Fasterisk.git Resolve an overlap in the ast_audiohook_flags values. AST_AUDIOHOOK_TRIGGER_WRITE and AST_AUDIOHOOK_WANTS_DTMF were overlapping which may have caused unintended side effects. This patch moves AST_AUDIOHOOK_TRIGGER_WRITE, and updates AST_AUDIOHOOK_TRIGGER_MODE to reflect the original intention. This will affect existing modules that use these flags, so be sure to recompile as necessary. (closes issue ASTERISK-19246) Reported by: feyfre git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@353598 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/audiohook.h b/include/asterisk/audiohook.h index abf6ca3457..0e92bd9c71 100644 --- a/include/asterisk/audiohook.h +++ b/include/asterisk/audiohook.h @@ -52,10 +52,15 @@ enum ast_audiohook_direction { AST_AUDIOHOOK_DIRECTION_BOTH, /*!< Both reading audio in and writing audio out */ }; +/* + * The flags here have been shifted around due to an unintended overlap between + * AST_AUDIOHOOK_TRIGGER_WRITE and AST_AUDIOHOOK_WANTS_DTMF. In future Asterisk + * releases (Asterisk 11+), these have been reorganized to make more sense. + */ enum ast_audiohook_flags { - AST_AUDIOHOOK_TRIGGER_MODE = (3 << 0), /*!< When audiohook should be triggered to do something */ + AST_AUDIOHOOK_TRIGGER_MODE = ((1 << 6) | (1 << 0)), /*!< When audiohook should be triggered to do something */ AST_AUDIOHOOK_TRIGGER_READ = (1 << 0), /*!< Audiohook wants to be triggered when reading audio in */ - AST_AUDIOHOOK_TRIGGER_WRITE = (2 << 0), /*!< Audiohook wants to be triggered when writing audio out */ + AST_AUDIOHOOK_TRIGGER_WRITE = (1 << 6), /*!< Audiohook wants to be triggered when writing audio out */ AST_AUDIOHOOK_WANTS_DTMF = (1 << 1), /*!< Audiohook also wants to receive DTMF frames */ AST_AUDIOHOOK_TRIGGER_SYNC = (1 << 2), /*!< Audiohook wants to be triggered when both sides have combined audio available */ /*! Audiohooks with this flag set will not allow for a large amount of samples to build up on its @@ -64,6 +69,8 @@ enum ast_audiohook_flags { AST_AUDIOHOOK_SMALL_QUEUE = (1 << 3), AST_AUDIOHOOK_MUTE_READ = (1 << 4), /*!< audiohook should be mute frames read */ AST_AUDIOHOOK_MUTE_WRITE = (1 << 5), /*!< audiohook should be mute frames written */ + + /* IMPORTANT: When adding new flags, start with (1 << 7) */ }; #define AST_AUDIOHOOK_SYNC_TOLERANCE 100 /*< Tolerance in milliseconds for audiohooks synchronization */