summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-08-23 18:33:36 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-08-23 18:33:36 +0000
commit6ebfac8e70b0863fd96ee4fe6ca4b254696fe9c4 (patch)
treedf6a91c733cc32ae5179493b800384824dcdcfa3 /include
parent31ab4866275aa28f6ec9fe7ce166b4f86f8ecf24 (diff)
Handle DTMF and hold wrapup when a channel leaves the bridging system.
DTMF start/end and hold/unhold events have state because a DTMF begin event and hold event must be ended by something. The following cases need to be handled when a channel is moved around in the system. * When a channel leaves a bridge it may owe a DTMF end event to the bridge. * When a channel leaves a bridge it may owe an UNHOLD event to the bridge. (This case is explicitly ignored because things like transfers need explicit control over this.) * When a channel leaves the bridging system it may need to simulate a DTMF end event to the channel. * When a channel leaves the bridging system it may need to simulate an UNHOLD event to the channel. The patch also fixes the following: * Fixes playing a file and restarting MOH using the latest MOH class used. (closes issue ASTERISK-22043) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2791/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/bridge_channel.h7
-rw-r--r--include/asterisk/bridge_channel_internal.h14
-rw-r--r--include/asterisk/channel.h4
3 files changed, 25 insertions, 0 deletions
diff --git a/include/asterisk/bridge_channel.h b/include/asterisk/bridge_channel.h
index ae5131cef..149c8e0d1 100644
--- a/include/asterisk/bridge_channel.h
+++ b/include/asterisk/bridge_channel.h
@@ -155,6 +155,13 @@ struct ast_bridge_channel {
* \note Needs to be atomically settable.
*/
enum bridge_channel_thread_state activity;
+ /*! Owed events to the bridge. */
+ struct {
+ /*! Time started sending the current digit. (Invalid if owed.dtmf_digit is zero.) */
+ struct timeval dtmf_tv;
+ /*! Digit currently sending into the bridge. (zero if not sending) */
+ char dtmf_digit;
+ } owed;
};
/*!
diff --git a/include/asterisk/bridge_channel_internal.h b/include/asterisk/bridge_channel_internal.h
index 1108c88d7..09a447d61 100644
--- a/include/asterisk/bridge_channel_internal.h
+++ b/include/asterisk/bridge_channel_internal.h
@@ -84,6 +84,20 @@ struct ast_bridge_channel *bridge_channel_internal_alloc(struct ast_bridge *brid
/*!
* \internal
+ * \brief Clear owed events by the channel to the original bridge.
+ * \since 12.0.0
+ *
+ * \param orig_bridge Original bridge the channel was in before leaving.
+ * \param bridge_channel Channel that owes events to the original bridge.
+ *
+ * \note On entry, the orig_bridge is already locked.
+ *
+ * \return Nothing
+ */
+void bridge_channel_settle_owed_events(struct ast_bridge *orig_bridge, struct ast_bridge_channel *bridge_channel);
+
+/*!
+ * \internal
* \brief Push the bridge channel into its specified bridge.
* \since 12.0.0
*
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 0175d678c..24dc53f6b 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -3792,6 +3792,7 @@ void ast_channel_name_set(struct ast_channel *chan, const char *name);
DECLARE_STRINGFIELD_SETTERS_FOR(name);
DECLARE_STRINGFIELD_SETTERS_FOR(language);
DECLARE_STRINGFIELD_SETTERS_FOR(musicclass);
+DECLARE_STRINGFIELD_SETTERS_FOR(latest_musicclass);
DECLARE_STRINGFIELD_SETTERS_FOR(accountcode);
DECLARE_STRINGFIELD_SETTERS_FOR(peeraccount);
DECLARE_STRINGFIELD_SETTERS_FOR(userfield);
@@ -3805,6 +3806,7 @@ DECLARE_STRINGFIELD_SETTERS_FOR(dialcontext);
const char *ast_channel_name(const struct ast_channel *chan);
const char *ast_channel_language(const struct ast_channel *chan);
const char *ast_channel_musicclass(const struct ast_channel *chan);
+const char *ast_channel_latest_musicclass(const struct ast_channel *chan);
const char *ast_channel_accountcode(const struct ast_channel *chan);
const char *ast_channel_peeraccount(const struct ast_channel *chan);
const char *ast_channel_userfield(const struct ast_channel *chan);
@@ -3857,6 +3859,8 @@ int ast_channel_timingfd(const struct ast_channel *chan);
void ast_channel_timingfd_set(struct ast_channel *chan, int value);
int ast_channel_visible_indication(const struct ast_channel *chan);
void ast_channel_visible_indication_set(struct ast_channel *chan, int value);
+int ast_channel_hold_state(const struct ast_channel *chan);
+void ast_channel_hold_state_set(struct ast_channel *chan, int value);
int ast_channel_vstreamid(const struct ast_channel *chan);
void ast_channel_vstreamid_set(struct ast_channel *chan, int value);
unsigned short ast_channel_transfercapability(const struct ast_channel *chan);