Skip to main content

<Say>

Converts text to speech and plays it to the caller. Supports plain text and SSML tags.

Attributes​

AttributeRequiredDefaultDescription
voiceNowomanVoice to use: man or woman
languageNoenLanguage code (e.g., en, hi, ta, te, kn, ml, bn, mr)
loopNo1Number of times to repeat. 0 = repeat indefinitely until interrupted

Syntax​

<Say voice="woman" language="en">Hello, welcome to Acme Corp.</Say>
<!-- Hindi greeting -->
<Say language="hi">नमस्ते, एक्सोटेल में आपका स्वागत है।</Say>

Inside Gather​

<Say> can appear inside <Gather> to prompt callers before collecting input:

<Gather numDigits="1" action="https://your-app.example.com/ivr">
<Say>Press 1 for Sales, 2 for Support.</Say>
</Gather>

SSML support​

Exotel's TTS engine supports a subset of SSML for controlling speech:

<Say>
Your order total is <say-as interpret-as="currency">INR 1500</say-as>.
<break time="500ms"/>
Thank you for your purchase.
</Say>

Legs API — StartSay / StopSay​

For mid-call text-to-speech on an active leg, use the Legs API actions:

# Start TTS on an active leg
curl -u '<api_key>:<api_token>' -X POST \
'https://cpaas-api.in.exotel.com/v2/accounts/<account_sid>/legs/<leg_sid>/actions/start_say' \
-H 'Content-Type: application/json' \
-d '{"text": "Please hold while we connect you.", "loop": 0}'

# Stop TTS
curl -u '<api_key>:<api_token>' -X POST \
'https://cpaas-api.in.exotel.com/v2/accounts/<account_sid>/legs/<leg_sid>/actions/stop_say'

Or using ExoML in a Legs API action:

curl -u '<api_key>:<api_token>' -X POST \
'https://cpaas-api.in.exotel.com/v2/accounts/<account_sid>/legs/<leg_sid>/actions' \
-H 'Content-Type: application/json' \
-d '{
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartSay>Please hold while we connect you.</StartSay></Flow>"
}'

StartSay parameters​

ParameterRequiredDescription
textYesText to speak. Plain text or SSML.
loopNoRepeat count (0 = once, -1 = indefinitely)

Events emitted​

EventDescription
say_startedTTS playback has begun
say_completedTTS playback finished
say_stoppedTTS playback stopped early via stop_say

Best practices​

  • Keep messages under 30 seconds — callers lose focus on long prompts
  • Use loop: 0 for hold music equivalents, then call stop_say when ready to proceed
  • For multilingual deployments, detect the caller's language from your CRM before returning the greeting verb