diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-08-23 18:33:36 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-08-23 18:33:36 +0000 |
commit | 6ebfac8e70b0863fd96ee4fe6ca4b254696fe9c4 (patch) | |
tree | df6a91c733cc32ae5179493b800384824dcdcfa3 /main/channel_internal_api.c | |
parent | 31ab4866275aa28f6ec9fe7ce166b4f86f8ecf24 (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 'main/channel_internal_api.c')
-rw-r--r-- | main/channel_internal_api.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index 122b8cfdf..956816d76 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -96,6 +96,7 @@ struct ast_channel { AST_STRING_FIELD(name); /*!< ASCII unique channel name */ AST_STRING_FIELD(language); /*!< Language requested for voice prompts */ AST_STRING_FIELD(musicclass); /*!< Default music class */ + AST_STRING_FIELD(latest_musicclass); /*!< Latest active music class */ AST_STRING_FIELD(accountcode); /*!< Account code for billing */ AST_STRING_FIELD(peeraccount); /*!< Peer account code for billing */ AST_STRING_FIELD(userfield); /*!< Userfield for CEL billing */ @@ -190,6 +191,7 @@ struct ast_channel { int epfd; #endif int visible_indication; /*!< Indication currently playing on the channel */ + int hold_state; /*!< Current Hold/Unhold state */ unsigned short transfercapability; /*!< ISDN Transfer Capability - AST_FLAG_DIGITAL is not enough */ @@ -444,6 +446,7 @@ void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) DEFINE_STRINGFIELD_SETTERS_FOR(name, 0, 1); DEFINE_STRINGFIELD_SETTERS_FOR(language, 1, 0); DEFINE_STRINGFIELD_SETTERS_FOR(musicclass, 0, 0); +DEFINE_STRINGFIELD_SETTERS_FOR(latest_musicclass, 0, 0); DEFINE_STRINGFIELD_SETTERS_FOR(accountcode, 1, 0); DEFINE_STRINGFIELD_SETTERS_FOR(peeraccount, 1, 0); DEFINE_STRINGFIELD_SETTERS_FOR(userfield, 0, 0); @@ -462,6 +465,7 @@ DEFINE_STRINGFIELD_SETTERS_FOR(dialcontext, 0, 0); DEFINE_STRINGFIELD_GETTER_FOR(name); DEFINE_STRINGFIELD_GETTER_FOR(language); DEFINE_STRINGFIELD_GETTER_FOR(musicclass); +DEFINE_STRINGFIELD_GETTER_FOR(latest_musicclass); DEFINE_STRINGFIELD_GETTER_FOR(accountcode); DEFINE_STRINGFIELD_GETTER_FOR(peeraccount); DEFINE_STRINGFIELD_GETTER_FOR(userfield); @@ -645,6 +649,14 @@ void ast_channel_visible_indication_set(struct ast_channel *chan, int value) { chan->visible_indication = value; } +int ast_channel_hold_state(const struct ast_channel *chan) +{ + return chan->hold_state; +} +void ast_channel_hold_state_set(struct ast_channel *chan, int value) +{ + chan->hold_state = value; +} int ast_channel_vstreamid(const struct ast_channel *chan) { return chan->vstreamid; |