Call Us Today! 877.742.2583




Page tree
Skip to end of metadata
Go to start of metadata

 Table of Contents (click to expand)


0. About

Record to a file from the channel's input media stream.

1. Syntax

record <path> [<time_limit_secs>] [<silence_threshold>] [<silence_hits>]

Record is used to record voice messages, such as in a voicemail system.

ParameterDescriptionDefault value

path

Record to file specified by given path in the format that the file's extension specifies. See 2. File Formats below for specifics.

If only filename is given the it will be saved to channel variable sound_prefix, or base_dir when sound_prefix not set.
time_limit_secs(optional) The maximum duration of the recording in seconds.

TODO Is there a default?

silence_threshold(optional) The energy level below which is considered silence.

TODO What is the default?

siilence_hits(optional) The number of seconds of audio below silence_threshold will be tolerated before the recording stops.3 seconds

2. File Formats

The file extension in <path> determines the recorded file's format. 

Use the console command show file to display available formats in fs_cli or type fs_cli -x 'show file' in the terminal of your operating system.

For example,

  • record_session /tmp/test.gsm 
    will produce a GSM encoded voice file which is raw data and is not in any container (e.g. wav, ogg, etc.). The sampling rate can not be influenced by the filename.
  • record_session /tmp/test.mp3 
    will produce an MP3 file if mod_shout is loaded.

You can use external applications such as soxlame, ffmpeg etc. to resample or otherwise manipulate the recorded file.

3. How to stop the recordings?

Either by hanging up, or setting the playback_terminators variable.

After recording stops, the record app sets the following read-only channel variables:

The record app sets no record status. TODO What does this mean?

4. Examples

Record app example
<action application="playback" data="/var/sounds/beep.gsm"/>
<!--default terminator is *. Keyword 'none' disables on-key termination /-->

<!--following line will set # as recording session terminator /-->
<action application="set" data="playback_terminators=#"/> 
<action application="record" data="/tmp/data.wav 20 200"/>

5. Recording-related channel variables

6. See also