O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required