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
This commit is contained in:
Richard Mudgett
2013-08-23 18:33:36 +00:00
parent 31ab486627
commit 6ebfac8e70
9 changed files with 139 additions and 32 deletions

View File

@@ -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);