PlayEarlyMedia

When an inbound call triggers the voice URL on a FreeClimb application, the PlayEarlyMediacommand is sent before a call has been answered, hung up, or rejected. It can only be in the PerCL script returned for an incoming Call. In such cases, one or more PlayEarlyMedia commands can be executed before FreeClimb attempts to connect the call. The audio file it uses can be stored in any location that is accessible via URL.

FreeClimb supports multi-channel 8 bit audio a-law/μ-law formats and 16 bits audio pcm format with an audio sampling rate of between 1000 and 96000. The max download size is 100MB. You can convert files to this format using an audio editor. Audacity is a free, open source option.

  1. Import the high quality source audio
  2. Adjust the project rate to 8 kHz.
  3. Export the track using the μ-law encoding.

Nesting Rules

No commands can be nested within PlayEarlyMedia and the PlayEarlyMedia command cannot be nested in any other commands.

Example

This PerCL script plays a greeting as the first command.

[
   {
      "PlayEarlyMedia" : {
         "file" : "http://www.foo.com/greeting.wav"
      }
   }
]

Command Attributes

PlayEarlyMedia supports the following attributes that modify its behavior:

file

REQUIRED

Type: string
Default: null

URL of the audio file to be played to the caller. The URL can be the recordingUrl generated from the RecordUtterance or StartRecordCall PerCL commands or any accessible URL.

FreeClimb will respect Cache-Control headers for this file. See Cache-Control Headers below for more details.

Cache-Control Headers

Use headers to limit repeated requests for unchanged audio. If no Cache-Control header is provided, the file will be cached for 5 seconds by default. FreeClimb supports the following headers and Cache-Control directives:

Header

Type

Cache-Control

General header

Pragma

General header

Expires

Response header

ETag

Response header

Last-Modified

Response header

Cache-Control Request Directive

FreeClimb Support

max-age

Supported

no-cache

Supported

no-store

Supported

private

Unsupported

public

Unsupported

must-revalidate

Unsupported

no-transform

Unsupported

proxy-revalidate

Unsupported

s-maxage

Unsupported