<Response> and execute in order.123<Response> <Say voice="alice" language="en-NG" loop="1">Welcome to Ruut Voice.</Say> </Response>
| Parameter | Type | Description |
voice optional | string | TTS voice (e.g. alice, man). |
language optional | string | Language code (e.g. en-NG, en). |
loop optional | integer | Times to repeat (0 = infinite). Default 1. |
response.say("…", { voice: "alice", language: "en-NG" })123<Response> <Play loop="1">https://cdn.example.com/greeting.mp3</Play> </Response>
| Parameter | Type | Description |
loop optional | integer | Times to repeat (0 = infinite). Default 1. |
response.play("https://cdn.example.com/greeting.mp3", { loop: 1 })action URL with the input.123456<Response> <Gather numDigits="1" action="/twiml/menu" method="POST"> <Say>Press 1 for sales. Press 2 for support.</Say> </Gather> <Say>No input received.</Say> </Response>
| Parameter | Type | Description |
action optional | string | URL to request when gathering finishes (with Digits). |
method optional | string | HTTP method for action: GET or POST. |
numDigits optional | integer | Number of digits to collect before proceeding. |
finishOnKey optional | string | Digit that ends gathering (e.g. #). |
timeout optional | integer | Seconds to wait for input. Default 5. |
actionOnEmptyResult optional | boolean | Request action even when no input is received. |
response.gather({ numDigits: 1, action: "/twiml/menu" }, (g) => g.say("Press 1 for sales."))1234<Response> <Say>Please leave a message after the tone.</Say> <Record transcribe="true" transcribeCallback="/twiml/transcription" maxLength="120" playBeep="true" /> </Response>
| Parameter | Type | Description |
action optional | string | URL to request when recording completes. |
method optional | string | HTTP method for action. |
timeout optional | integer | Seconds of silence before finishing. Default 5. |
finishOnKey optional | string | Key that ends the recording. |
maxLength optional | integer | Maximum recording length in seconds. Default 3600. |
playBeep optional | boolean | Play a beep before recording. Default true. |
transcribe optional | boolean | Transcribe the recording after it completes. |
transcribeCallback optional | string | URL to receive the transcription webhook. |
recordingStatusCallback optional | string | URL to receive recording status webhooks. |
response.record({ transcribe: true, transcribeCallback: "/twiml/transcription" })123<Response> <Dial record="record-from-answer-dual" callerId="+2348000000002">+2348000000009</Dial> </Response>
| Parameter | Type | Description |
callerId optional | string | Caller ID presented to the destination. |
record optional | string | Recording mode: do-not-record, record-from-answer, record-from-ringing, record-from-answer-dual, record-from-ringing-dual. |
recordingTrack optional | string | Track(s) to record: inbound, outbound, or both. |
recordingStatusCallback optional | string | URL for recording status webhooks. |
recordingStatusCallbackMethod optional | string | HTTP method for the callback. |
recordingStatusCallbackEvent optional | string | Events to notify on (e.g. in-progress completed absent). |
timeout optional | integer | Seconds to ring before giving up. Default 60. |
<Number> — dial an E.164 number.<Sip> — dial a SIP URI (e.g. sip:agent-1001@sip.ruut.chat).<Client> — dial a registered client/softphone identity.<Conference> — join a conference; see recording for recording conferences.123456// Conference with recording new VoiceResponse() .dial({ record: "record-from-answer-dual" }, (d) => { d.conference("support-room", { startConferenceOnEnter: true, endConferenceOnExit: false }); }) .toXml();
1234<Response> <Say>Checking your account.</Say> <Pause length="2" /> </Response>
| Parameter | Type | Description |
length optional | integer | Seconds to pause. Default 1. |
123<Response> <Redirect method="POST">https://app.example.com/twiml/next</Redirect> </Response>
| Parameter | Type | Description |
method optional | string | HTTP method for the URL: GET or POST. |
123<Response> <Reject reason="busy" /> </Response>
| Parameter | Type | Description |
reason optional | string | Rejection reason: rejected or busy. |
1234<Response> <Say>Goodbye.</Say> <Hangup /> </Response>
12345<Response> <Connect> <Stream url="wss://app.example.com/audio" /> </Connect> </Response>
| Parameter | Type | Description |
url optional | string | WebSocket URL to stream audio to (on <Stream>). |
name optional | string | Stream name. |
track optional | string | Track(s): inbound_track, outbound_track, or both_tracks. |