Web Responder XML Verbs

Every verb and attribute a Web Responder can return.

Your Web Responder controls a call by returning XML verbs. This page lists every supported verb. For how requests and responses fit together, see Web Responders.

VerbWhat it does
<Response>Groups several verbs so they run in order from one request
<Say>Speaks text to the caller using text-to-speech
<Play>Plays an audio file
<Gather>Collects keypad digits, speech, or both
<Forward>Sends the call to another destination
<Wait>Pauses before the next verb
<Echo>Plays the caller's audio back to them, for testing
<Hangup>Ends the call
<Reject>Refuses the call before it's answered
<Start>, <Connect>, <Stop>Start and stop media streams. See Media Streaming.

The action attribute

Most verbs accept an action attribute. When the verb finishes, Level365 sends a request to the action URL, and your application returns the next verbs. If a verb has no action and nothing follows it, the Web Responder ends.

Response

<Response> wraps several verbs so you can run a sequence from a single request. Level365 runs the verbs in order. If a verb inside has an action, control moves to that URL as soon as that verb finishes, and any verbs after it are skipped. When the last verb finishes, the call ends.

<Response>
  <Say>This is the first message.</Say>
  <Say action="next.php">This is the second message. Control moves to next.php after it.</Say>
  <Say>This message is never spoken, because control already moved to next.php.</Say>
</Response>

Say

<Say> converts text to speech and speaks it to the caller.

<Say>Hello, this is a simple text-to-speech message.</Say>
AttributeDescription
voiceA gender (male or female), a voice name, or a voice ID. If you set both a voice ID and a language that don't match, the default voice for your domain is used instead.
languageA BCP-47 language code, such as en-US, pt-BR, or fr-CA.
actionURL to request when the verb finishes.

If you leave out voice and language, the default voice and language configured for the Web Responder's system user (or its domain) is used.

<Response>
  <Say voice="male">Hello there! How are you?</Say>
  <Say voice="female" language="en-AU">G'day! How's it going?</Say>
  <Say voice="pt-BR-Wavenet-C" language="pt-BR">Olá! Como você está?</Say>
</Response>

Play

<Play> plays an audio file from a URL. The file must be WAV or MP3.

<Play action="continue.php">https://www.example.com/hello-world.wav</Play>
AttributeDescription
actionURL to request when playback finishes. Leave it out to end the Web Responder after playback.

Gather

<Gather> collects keypad (DTMF) digits, speech, or both, then sends the result to the action URL as the Digits or SpeechResult parameter.

You can nest <Say> or <Play> inside <Gather> to prompt the caller while it listens.

<Gather input="dtmf speech" numDigits="1" action="menu.php">
  <Say>Press 1 or say sales for sales. Press 2 or say support for support.</Say>
</Gather>
AttributeDescription
inputWhat to collect: dtmf, speech, or dtmf speech. Without speech, only digits are collected.
numDigitsThe maximum number of digits to collect. Defaults to 20.
timeoutHow long to wait for keypad input.
digitEndTimeoutThe longest allowed gap between keypresses.
hintsWords or names you expect the caller to say, which improves speech accuracy. For example, a list of last names for a company directory.
languageThe language to recognize, as a BCP-47 code such as en-US.
modelThe speech recognition model to use, for example nova-2-general.
smartFormatyes or no. Formats the transcript with punctuation, dates, times, and numbers. For example, "hi its me its five thirty five am" becomes "Hi, it's me. It's 5:35 AM."
numeralsyes or no. Converts numbers spoken as words into digits, for example "nine hundred" to "900".
actionURL that receives the collected Digits or SpeechResult.
📘

Speech recognition

Speech input and the model, smartFormat, and numerals attributes require speech recognition to be configured for your domain. Ask Level365 support when you request setup.

Forward

<Forward> sends the call to another destination, such as a phone number, user, or queue. It doesn't take an action: once the call is forwarded, the Web Responder is done.

<Forward>13175551234</Forward>
AttributeDescription
ByCalleryes to use the caller's dial plan instead of the call owner's. Use this only when the call reaches the Web Responder without going through a user first. See Call ownership.
<Forward ByCaller="yes">+13175551234</Forward>

Wait

<Wait> pauses before running the next verb, for example to space out prompts.

<Response>
  <Say>Hold on, we are connecting your call.</Say>
  <Wait timeout="5"/>
  <Say>Thank you for waiting.</Say>
</Response>
AttributeDescription
timeoutHow many seconds to wait. Defaults to 1.

Echo

<Echo> plays the caller's audio straight back to them, which is useful for testing a microphone and speaker.

<Response>
  <Say>After the pause, talk and you'll hear yourself.</Say>
  <Wait timeout="2"/>
  <Echo timeout="15"/>
</Response>
AttributeDescription
timeoutHow many seconds to echo. Defaults to 0, which echoes until the caller hangs up.

Hangup

<Hangup> ends the call. It must be inside a <Response>, and it can't contain other verbs.

<Response>
  <Say>Goodbye.</Say>
  <Hangup/>
</Response>

Reject

<Reject> refuses the call before it's answered. It must be inside a <Response>. Use the reason attribute to choose the response the caller's side receives:

reasonSIP response
busy486 Busy Here
rejected603 Decline
unavailable503 Service Unavailable
<Response>
  <Reject reason="busy"/>
</Response>

Stream

<Stream> sends live call audio to your WebSocket server. Use it inside:

  • <Start> to stream in the background while the call continues
  • <Connect> for two-way audio between the call and your application
  • <Stop> to end a named background stream
<Response>
  <Start>
    <Stream name="my_stream" url="wss://example.com/audio"/>
  </Start>
  <Say>This plays while the audio streams.</Say>
</Response>

See Web Responder Media Streaming for attributes, custom parameters, and the WebSocket messages your server receives.


Did this page help you?