aboutsummaryrefslogtreecommitdiffstats
path: root/main/autoservice.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-20 22:30:46 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-20 22:30:46 +0000
commit3375c0eb73bebd2fa38af23438779b0299be1e0a (patch)
tree0fc2968c4931205c953e394b324f03665b4feed8 /main/autoservice.c
parent92a6af8e056b973b391d10da3706dfa8e935024c (diff)
Merged revisions 278272 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r278272 | tilghman | 2010-07-20 17:26:23 -0500 (Tue, 20 Jul 2010) | 11 lines Merged revisions 278167 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r278167 | tilghman | 2010-07-20 15:59:06 -0500 (Tue, 20 Jul 2010) | 4 lines Do not queue up DTMF frames while a call is on hold. (Fixes ABE-2110) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@278273 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/autoservice.c')
-rw-r--r--main/autoservice.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/main/autoservice.c b/main/autoservice.c
index 6b9633301..731038fef 100644
--- a/main/autoservice.c
+++ b/main/autoservice.c
@@ -56,6 +56,7 @@ struct asent {
* it gets stopped for the last time. */
unsigned int use_count;
unsigned int orig_end_dtmf_flag:1;
+ unsigned int ignore_frame_types;
/*! Frames go on at the head of deferred_frames, so we have the frames
* from newest to oldest. As we put them at the head of the readq, we'll
* end up with them in the right order for the channel's readq. */
@@ -286,7 +287,9 @@ int ast_autoservice_stop(struct ast_channel *chan)
ast_channel_lock(chan);
while ((f = AST_LIST_REMOVE_HEAD(&as->deferred_frames, frame_list))) {
- ast_queue_frame_head(chan, f);
+ if (!((1 << f->frametype) & as->ignore_frame_types)) {
+ ast_queue_frame_head(chan, f);
+ }
ast_frfree(f);
}
ast_channel_unlock(chan);
@@ -296,6 +299,23 @@ int ast_autoservice_stop(struct ast_channel *chan)
return res;
}
+int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype)
+{
+ struct asent *as;
+ int res = -1;
+
+ AST_LIST_LOCK(&aslist);
+ AST_LIST_TRAVERSE(&aslist, as, list) {
+ if (as->chan == chan) {
+ res = 0;
+ as->ignore_frame_types |= (1 << ftype);
+ break;
+ }
+ }
+ AST_LIST_UNLOCK(&aslist);
+ return res;
+}
+
void ast_autoservice_init(void)
{
ast_cond_init(&as_cond, NULL);