summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-01-22 15:16:20 +0000
committerMatthew Jordan <mjordan@digium.com>2013-01-22 15:16:20 +0000
commit7d9871b3940fa50e85039aef6a8fb9870a7615b9 (patch)
tree05484de8505feb85d1e304b8868a87e29c0ca9f5 /main/channel.c
parent985ea8b2c96ff16b5cbe4cd102b9224e171b2984 (diff)
Add ControlPlayback manager action
This patch adds the capability for asynchronous manipulation of audio being played back to a channel though a new AMI action "ControlPlayback". The ControlPlayback action supports a number of operations, the availability of which depend on the application being used to send audio to the channel. When the audio playback was initiated using the ControlPlayback application or CONTROL STREAM FILE AGI command, the audio can be paused, stopped, restarted, reversed, or skipped forward. When initiated by other mechanisms (such as the Playback application), the audio can be stopped, reversed, or skipped forward. Review: https://reviewboard.asterisk.org/r/2265/ (closes issue ASTERISK-20882) Reported by: mjordan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 048975d12..dee6fe321 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3700,6 +3700,17 @@ int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, int audiofd, in
ast_frfree(f);
ast_clear_flag(ast_channel_flags(c), AST_FLAG_END_DTMF_ONLY);
return -1;
+ case AST_CONTROL_STREAM_STOP:
+ case AST_CONTROL_STREAM_SUSPEND:
+ case AST_CONTROL_STREAM_RESTART:
+ case AST_CONTROL_STREAM_REVERSE:
+ case AST_CONTROL_STREAM_FORWARD:
+ /* Fall-through and treat as if it were a DTMF signal. Items
+ * that perform stream control will handle this. */
+ res = f->subclass.integer;
+ ast_frfree(f);
+ ast_clear_flag(ast_channel_flags(c), AST_FLAG_END_DTMF_ONLY);
+ return res;
case AST_CONTROL_PVT_CAUSE_CODE:
case AST_CONTROL_RINGING:
case AST_CONTROL_ANSWER:
@@ -4454,6 +4465,11 @@ static int attribute_const is_visible_indication(enum ast_control_frame_type con
case AST_CONTROL_MCID:
case AST_CONTROL_UPDATE_RTP_PEER:
case AST_CONTROL_PVT_CAUSE_CODE:
+ case AST_CONTROL_STREAM_STOP:
+ case AST_CONTROL_STREAM_SUSPEND:
+ case AST_CONTROL_STREAM_REVERSE:
+ case AST_CONTROL_STREAM_FORWARD:
+ case AST_CONTROL_STREAM_RESTART:
break;
case AST_CONTROL_INCOMPLETE:
@@ -4661,6 +4677,11 @@ int ast_indicate_data(struct ast_channel *chan, int _condition,
case AST_CONTROL_END_OF_Q:
case AST_CONTROL_MCID:
case AST_CONTROL_UPDATE_RTP_PEER:
+ case AST_CONTROL_STREAM_STOP:
+ case AST_CONTROL_STREAM_SUSPEND:
+ case AST_CONTROL_STREAM_REVERSE:
+ case AST_CONTROL_STREAM_FORWARD:
+ case AST_CONTROL_STREAM_RESTART:
/* Nothing left to do for these. */
res = 0;
break;