summaryrefslogtreecommitdiff
path: root/include/asterisk/bridge_channel.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-11-06 19:03:46 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-11-06 19:03:46 +0000
commit2878554bccbd279a86b7510d3561f2a82419e469 (patch)
treed89c1c5190219219a6d0bd33d93a70b7b187f9a1 /include/asterisk/bridge_channel.h
parent248c592292fdf380cc996ef9fb5c410ce3f48671 (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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/bridge_channel.h')
-rw-r--r--include/asterisk/bridge_channel.h25
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