The <Record/> Element

This element records the caller's voice and stores the file containing the audio recording.

Element Attributes

Attribute Name Description Allowed Values Default Value
action URL to be called when record completes absolute URL
timeout Seconds of silence before considering the recording complete (default 500). positive integer 15
finishOnKey Stop recording if this key is pressed. i any digit, #, * 1234567890*#
maxLength Maximum number of seconds to record (default 60). integer greater than 1 60 (1 min)
playBeep Play a beep before recording (true/false, default true). true, false true
filePath directory path to save the file to (inside your basix domain folder). Ex: "subfolder1/subfolder2/subfolder3". The filePath is created if it doesn't exist. Any file path none
fileName File name to be used for recording like "some_uuid.wav". If empty, a unique name is used. Any file name ending with suffix .wav none

If attribute action is set, it will be called with information about the result of the record operation.

Request Parameters

Parameter Description
RecordingFile Complete path to the recorded file.
RecordingDuration Recording length in milliseconds.
Digits If set, the digits pressed to stop the record.

Examples

Examples 1: Record a message

This is an example of an IVR recording a message from the caller. The element beeps and begins recording up to 30 seconds of audio.

1
2
3
4
5
<?xml version="1.0" encoding="UTF-8" ?>
<IVR>
	<Speak voice="en-US-Standard-C">Please leave a message after the beep. Press the star key when done.</Speak>
	<Record maxLength="30" timeout="15" finishOnKey="*" filePath="messages/maryj" fileName="happy_new_year.wav" action="https://somwhere.com/record_action"/>
</IVR>

The action URL can return another XML document to proceed the handling of the call. Ex:

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="UTF-8" ?>
<IVR>
	<Speak voice="en-US-Standard-C">Here is the recorded message.</Speak>
	<Play>messages/maryj/happy_new_year.wav</Play>
	<GetDigits action="http://somewhere.com/getdigits_action">
		<Speak voice="en-US-Standard-C">Press 1 to confirm recording. Press 2 to record the message again</Speak>
	</GetDigits>
</IVR>