B.95. Record()

Records audio from a channel to a file.
as of Asterisk 1.2:
Record(basename[.format[,maxSilence[,maxDuration[,options]]]])
Records audio from the channel and saves it in the file basename.format. If the file exists, it is overwritten.
Allowed options are:
format
Specifies the file format of the recording (g723, g729, gsm, h263, ulaw, alaw, wav, ...).
maxSilence
Defines the maximum duration of silence allowed before the recording is ended.
maxDuration
Defines the maximum duration of the recording. If not provided or if 0, there is no limit.
options
One or more of the following option flags may be set:
s
Does not record if the call has not been answered.
n
Does not answer but records even if the call has not been answered.
a
Appends the recording to an existing file instead of overwriting it.
t
The "*" DTMF key ends the call instead of the default "#" key.
q
Does not play a beep tone before recording.
x
Records all DTMF tones, including "#" and "*". The call ends when maxDuration is reached or the caller hangs up.
If basename contains %d, it is replaced by a number incremented by 1 for each new recording.
The caller may end recording by pressing the "#" key; if the caller hangs up before recording is complete, the recording is discarded.
Returns -1 on hang-up, otherwise returns 0.
; Record the caller's name:
exten => 123,1,Playback(please-say-your-name)
exten => 123,n,Record(/tmp/name.gsm,3,10)
exten => 123,n,Playback(/tmp/name)
Note the warnings regarding privacy under Monitor().

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'Record' =- 

[Synopsis]
Record to a file

[Description]
  Record(filename.format|silence[|maxduration][|options])

Records from the channel into a given filename. If the file exists it will
be overwritten.
- 'format' is the format of the file type to be recorded (wav, gsm, etc).
- 'silence' is the number of seconds of silence to allow before returning.
- 'maxduration' is the maximum recording duration in seconds. If missing
or 0 there is no maximum.
- 'options' may contain any of the following letters:
     'a' : append to existing recording rather than replacing
     'n' : do not answer, but record anyway if line not yet answered
     'q' : quiet (do not play a beep tone)
     's' : skip recording if the line is not yet answered
     't' : use alternate '*' terminator key (DTMF) instead of default '#'
     'x' : ignore all terminator keys (DTMF) and keep recording until hangup

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

Use 'show file formats' to see the available formats on your system

User can press '#' to terminate the recording and continue to the next priority.

If the user should hangup during a recording, all data will be lost and the
application will teminate.
diff output to internal help in Asterisk 1.2:
21,22c21
<      't' : use alternate '*' terminator key (DTMF) instead of default '#'
<      'x' : ignore all terminator keys (DTMF) and keep recording until hangup
---
>      't' : use alternate '*' terminator key instead of default '#'