# Asterisk Project : Asterisk 13 AGICommand_control stream file

Created by wikibot on Aug 08, 2014

# CONTROL STREAM FILE

### Synopsis

Sends audio file on channel and allows the listener to control the stream.

### Description

Send the given file, allowing playback to be controlled by the given digits, if any. Use double quotes for the digits if you wish none to be permitted. If offsetms is provided then the audio will seek to offsetms before play starts. Returns `0` if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed, or `-1` on error or if the channel was disconnected. Returns the position where playback was terminated as endpos.

It sets the following channel variables upon completion:

- `CPLAYBACKSTATUS` - Contains the status of the attempt as a text string
  - SUCCESS
  - USERSTOPPED
  - REMOTESTOPPED
  - ERROR
- `CPLAYBACKOFFSET` - Contains the offset in ms into the file where playback was at when it stopped. `-1` is end of file.
- `CPLAYBACKSTOPKEY` - If the playback is stopped by the user this variable contains the key that was pressed.

### Syntax

    CONTROL STREAM FILE FILENAME ESCAPE_DIGITS SKIPMS FFCHAR REWCHR PAUSECHR OFFSETMS

##### Arguments

- `filename` - The file extension must not be included in the filename.
- `escape_digits`
- `skipms`
- `ffchar` - Defaults to `*`
- `rewchr` - Defaults to `#`
- `pausechr`
- `offsetms` - Offset, in milliseconds, to start the audio playback

### See Also

### Import Version

This documentation was imported from Asterisk Version SVN-branch-13-r420538