diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-11-06 19:12:18 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-11-06 19:12:18 +0000 |
commit | a68baad74faedd7eb557aff8d51ae5c96d427d7a (patch) | |
tree | 5e24437b94d1538d86c10a54d4329156aa864da1 /include/asterisk/bridge_channel.h | |
parent | 47074f4bfd290b65e242f1aea767d85e39c5ea71 (diff) |
Bridge DTMF hooks: Made audio pass from the bridge while waiting for more matching digits.
* Made collecting DTMF digits for the DTMF feature hooks pass frames from
the bridge.
* Made collecting DTMF digits possible by other bridge hooks if there is a
need.
ASTERISK-24447 #close
Reported by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/4123/
........
Merged revisions 427493 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 427494 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/bridge_channel.h')
-rw-r--r-- | include/asterisk/bridge_channel.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/asterisk/bridge_channel.h b/include/asterisk/bridge_channel.h index 387c048f8..1d071a014 100644 --- a/include/asterisk/bridge_channel.h +++ b/include/asterisk/bridge_channel.h @@ -53,6 +53,7 @@ extern "C" { #endif +#include "asterisk/bridge_features.h" #include "asterisk/bridge_technology.h" /*! \brief State information about a bridged channel */ @@ -162,6 +163,13 @@ struct ast_bridge_channel { /*! Digit currently sending into the bridge. (zero if not sending) */ char dtmf_digit; } owed; + /*! DTMF hook sequence state */ + struct { + /*! Time at which the DTMF hooks should stop waiting for more digits to come. */ + struct timeval interdigit_timeout; + /*! Collected DTMF digits for DTMF hooks. */ + char collected[MAXIMUM_DTMF_FEATURE_STRING]; + } dtmf_hook_state; }; /*! @@ -647,6 +655,23 @@ int ast_bridge_channel_write_park(struct ast_bridge_channel *bridge_channel, con */ void ast_bridge_channel_kick(struct ast_bridge_channel *bridge_channel, int cause); +/*! + * \brief Add a DTMF digit to the collected digits to match against DTMF features. + * \since 12.8.0 + * + * \param bridge_channel Channel that received a DTMF digit. + * \param digit DTMF digit to add to collected digits or 0 for timeout event. + * + * \note Neither the bridge nor the bridge_channel locks should be held + * when entering this function. + * + * \note This is intended to be called by bridge hooks and the + * bridge channel thread. + * + * \return Nothing + */ +void ast_bridge_channel_feature_digit(struct ast_bridge_channel *bridge_channel, int digit); + #if defined(__cplusplus) || defined(c_plusplus) } #endif |