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.
Parameter | Description | Default value |
---|---|---|
| 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 ifmod_shout
is loaded.
You can use external applications such as sox
, lame
, 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:
record_ms
— duration of most recently recorded file in millisecondsrecord_samples
— number of recorded samplesplayback_terminator_used
— TouchTone digit used to terminate recording
The record app sets no record status. TODO What does this mean?
4. Examples
<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
- RECORD_COPYRIGHT
- RECORD_SOFTWARE
- RECORD_ARTIST
- RECORD_COMMENT
- RECORD_DATE
- record_waste_resources
- record_sample_rate
- RECORD_WRITE_ONLY
- RECORD_READ_ONLY
- RECORD_APPEND
- record_samples
- record_ms
6. See also
mod_dptools: record_session
uuid_record
inmod_commands