Name

Record() — Records channel audio to a file

Synopsis

    Record(filename:format,silence[,maxduration][,options]) (in Asterisk 1.0.x)
    Record(filename.format,silence[,maxduration][,options]) (in Asterisk 1.2.x)

Records audio from the channel into the given filename. If the file already exists, it will be overwritten.

Optional arguments include:

format

Specifies the format of the file type to be recorded. Valid formats include: g723, g729, gsm, h263, ulaw, alaw, vox, wav, and WAV.

silence

Specifies the number of seconds of silence to allow before returning.

maxduration

Specifies the maximum recording duration, in seconds. If missing or 0, there is no maximum.

options

May contain any of the following letters:

s

Skip recording if the line is not yet answered.

n

Do not answer, but record anyway if the line is not yet answered.

a

Append the recording to the existing recording rather than replacing it.

t

Use the alternate * terminator key instead of the default #.

If the filename contains %d, these characters will be replaced with a number incremented by one each time the file is recorded.

The user can press # to terminate the recording and continue to the next priority.

Returns -1 when the user hangs up.

    ; record the caller's name
    exten => 123,1,Playback(pls-rcrd-name-at-tone)
    exten => 123,2,Record(/tmp/name:gsm,3,30)
    exten => 123,3,Playback(/tmp/name)

Get Asterisk: The Future of Telephony now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.