{"startRecording":} object

Allows Tropo applications to begin recording the current session. The resulting recording may then be sent via FTP or an HTTP POST/Multipart Form.

Tips and Tricks

  • Recording files are 16 bit, 8KHz files, regardless of the audio type
  • If you record a conference or a transfer, you'll get a stereo recording. One channel contains the caller, the other contains the conference or transferred party.
  • Transcription results will be better if you use WAV as your audio type. The higher-quality audio gives more for the transcription engine to work with.

Fields

asyncUpload

Boolean
Default: 
false

Setting to true will instruct Tropo to upload the recording file in the background as soon as the recording is completed. This will cause the onRecord callback to run immediately and will cause the record function to return as soon as the recording is complete. Because the function returns before the recording has been uploaded, Tropo cannot inform the script of any errors in uploading, so the onError callback will never run, even if upload fails. If this is set to false (the default behavior), Tropo will wait until the file is uploaded before returning or running the onRecord callback, and will be able to report errors. The tradeoff is that no other Tropo operations run during upload, so if the recording file is very large or the receiving server is very slow, the caller will hear a large period of silence while the file uploads.

format

String
Default: 
audio/wav

This specifies the format for the audio recording; it can be 'audio/wav', 'audio/mp3' or 'audio/au'.

method

String
Default: 
POST

When submitting recordings via HTTP, this parameter determines the method used. This can be 'POST' (which is the default) or 'PUT' . When sending via POST, the name of the form field is "filename".

url

String
(Required)

This is the destination URL to send the recording. This can be an FTP destination, like so:

ftp://ftp.myServer.com/files/myRecording.wav

You can build your username and password directly inline with the URL, or you can define them with the individual "username" and "password" fields.

The recording is sent to your URL after the caller completes their recording. It will take several moments to upload this to your server, and the file will usually arrive some time after the API response arrives at your server.

Please note this needs to be a fully realized URL, i.e. "http://website.com/folder/subfolder" vs "/folder/subfolder". If you don't have a complete URL, the file won't send at all or at the very least won't send correctly (0 byte file and similar unusable content).

username

String

Defines the username for either HTTP Basic Auth or an FTP login.

Note: If the user and password field in the URL contains one of these characters : or @ or /, the character must be encoded.

password

String

Defines the password for either HTTP Basic Auth or an FTP login.

Note: If the user and password field in the URL contains one of these characters : or @ or /, the character must be encoded.

transcriptionEmailFormat

String
Default: 
plain

Specifies the encoding used when delivering transcriptions via e-mail. Values can be "plain" or "encoded".

transcriptionID

String
Default: 
none

User definable ID that can be included when the transcription is posted to transcriptionOutURI.

transcriptionOutURI

String
Default: 
none

The e-mail address or HTTP URL to send the transcription results to; the transcription arrives as the content of the HTTP POST, as opposed to a header, named field or variable, and is not sent as form data.

Note: Email addresses must be prefaced with mailto: if used (mailto:you@example.com)

Examples

Example with stopRecording

{
   "tropo":[
      {
         "startRecording":{
            "name":"myrecording",
            "url":"http://example.com/getrecord.php"
         }
      },
      {
         "say":[
            {
               "value":"I am now recording!"
            }
         ]
      },
      {
         "stopRecording":null
      }
   ]
}