Voice Broadcast API

Voice API
Quick Start Guides
Methods
Types
FAQ

TextToSay Script Samples

This page includes several example call scripts. They use TextToSay Commands to control the flow of the call.

Poll Question

This script reads out a poll question and waits for the call recipient to press a single digit in response. It will hang up if an answering machine is detected.

~\ActOnDigitPress(false)~
~\ClearDTMF()~
~\AssignDTMF(1|Voted)~
~\AssignDTMF(2|Voted)~
~\AssignDTMF(3|Voted)~
~\ActOnDigitPress(true)~
Hello, please take the next 30 seconds to participate in a poll for the 155th
district house of delegates. If the election were held today, would you vote
for Republican John Smith, press 1, Democrat Bob Jones, press 2, or undecided,
press 3.
~\WaitForDTMF(10)~
~\Goto(Start)~
~\Label(Voted)~
Your vote has been recorded. Thank you for your participation. Good night.
~\EndCall()~
~\Label(Amd)~
~\EndCall()~

School Closing

This script reads out a school closing message. It will read out a different message if an answering machine is detected.

~\ActOnDigitPress(false)~
~\ClearDTMF()~
~\SetVar(Attempt|1)~
~\Label(Start)~
Hello, this is Smith Public Schools calling to inform you that due to incoming
severe weather, school will be closed tomorrow, November 23, 2020.
~\Label(Menu)~
~\AssignDTMF(1|RepeatMessage)~
~\AssignDTMF(#|HangUp)~
~\ActOnDigitPress(true)~
To repeat the previous message, please press 1.
To end the call, please hang up or press the pound key.
~\WaitForDTMF(10)~
~\IncreaseVariable(Attempt|1)~
~\GotoIf(Attempt|1|Menu)~
~\GotoIf(Attempt|4|AttemptEnd)~
~\Label(RepeatMessage)~
~\Goto(Start)~
~\Label(AttemptEnd)~
~\EndCall()~
~\Label(HangUp)~
~\EndCall()~
~\Label(Amd)~
Hello, this is Smith Public Schools calling to inform you that due to incoming
severe weather, school will be closed tomorrow, November 23, 2020. Please take
necessary precautions to stay safe during the inclement weather.
Thank you and have a good night.
~\EndCall()~

School Announcement

~\ActOnDigitPress(false)~
~\ClearDTMF()~
~\SetVar(Attempt|1)~
~\Label(Start)~
Hello, This is North Sanders High School calling to inform you that your child
was found absent from school today.
~\Label(Menu)~
~\AssignDTMF(1|RepeatMessage)~
~\AssignDTMF(2|ChildHome)~
~\AssignDTMF(*|Advisor)~
~\ActOnDigitPress(true)~
To repeat this message, please press 1. To confirm that your child has been
kept home due to illness or other circumstances, please press 2. If you would
like to talk to an advisor at the school, please press star and your call will
be transferred.
~\WaitForDTMF(10)~
~\IncreaseVariable(Attempt|1)~
~\GotoIf(Attempt|4|AttemptEnd)~
~\Label(RepeatMessage)~
~\Goto(Menu)~
~\Label(AttemptEnd)~
~\EndCall()~
~\Label(ChildHome)~
Thank you for confirming that your child has been kept home from school today.
~\EndCall()~
~\Label(Advisor)~
Please hold while your call is transferred to an advisor.
~\TransferTo(1236547890)~
~\EndCall()~
~\Label(Amd)~
Hello, this is North Sanders High School calling to inform you that your child
was found absent from school today. Please contact an advisor at 1236547890 as
soon as possible to confirm that your child has been kept home today. Thank you.
~\EndCall()~

Registration Confirmation

~\ActOnDigitPress(false)~
~\ClearDTMF()~
~\SetVar(Attempt|1)~
Hello, my name is Bart. I am trying to reach Cecile Munsey. I am calling from
Bid Ville dot com to verify a V. I. P. membership. If this is not Cecile
Munsey, please accept my apology and ignore this call. If this is the correct
person, please have a pen and paper ready to write down your confirmation code.
~\Label(TopMenu)~
~\AssignDTMF(1|ConfirmationCode)~
~\AssignDTMF(*|RepeatMenu)~
~\AssignDTMF(#|HangUp)~
~\ActOnDigitPress(true)~
To receive your confirmation code, press 1.
If you are not Cecile Munsey, please press pound to terminate the call.
To repeat, press start.
~\WaitForDTMF(10)~
~\IncreaseVariable(Attempt|1)~
~\GotoIf(Attempt|1|TopMenu)~
~\GotoIf(Attempt|4|AttemptEnd)~
~\Label(RepeatMenu)~
Please choose from the following options.
~\Goto(TopMenu)~
~\Label(AttemptEnd)~
~\EndCall()~
~\Label(HangUp)~
~\EndCall()~
~\Label(ConfirmationCode)~
~\ClearDTMF()~
~\AssignDTMF(1|ConfirmationCode)~
Your Confirmation Code is 2, 1, 7, 1.
To repeat your Confirmation Code, press 1.
Or stay on the line for more information.
~\WaitForDTMF(5)~
Please return to the Bid Ville website and enter this code to confirm your
V. I. P. membership. You will also receive an email explaining where and how to
enter this code. Thank you for participating. Have a great day. Goodbye.
~\EndCall()~
~\Label(Amd)~
Hello, my name is Bart, from Bid Ville dot com. I am trying to reach Cecile
Munsey to verify a V. I. P. membership. If this is not Cecile Munsey, please
accept my apology and ignore this call. If this is the correct person, your
confirmation code is, 2, 1, 7, 1. Please return to the Bid Ville website and
enter this code to confirm your V. I. P. membership. You will also receive an
email explaining where and how to enter this code. Thank you for participating.
Have a great day. Goodbye.
~\EndCall()~

Survey

~\ActOnDigitPress(false)~
~\ClearDTMF()~
~\SetVar(Attempt|1)~
Hello, this is Roger's Car Dealership calling to see if you would be willing to
participate in our small survey about the service you received at your last
visit to our service center.
~\Label(TopMenu)~
~\AssignDTMF(1|Participate)~
~\AssignDTMF(*|DoNotParticipate)~
~\AssignDTMF(#|Repeat)~
~\ActOnDigitPress(true)~
If you would like to participate in our survey, please press 1.
If you do not wish to participate in our survey, press star.
To repeat, please press pound.
~\WaitForDTMF(10)~
~\IncreaseVariable(Attempt|1)~
~\GotoIf(Attempt|1|TopMenu)~
~\GotoIf(Attempt|4|AttemptEnd)~
~\Label(Repeat)~
Please choose from the following options.
~\Goto(TopMenu)~
~\Label(AttemptEnd)~
~\EndCall()~
~\Label(DoNotParticipate)~
Thank you for your time.
~\EndCall()~
~\Label(Participate)~
~\ClearDTMF()~
This survey consists of four questions, and should only take a couple of
minutes to complete.
~\Goto(QuestionOne)~
~\Label(QuestionOne)~
~\AssignDTMF(1|Quick)~
~\AssignDTMF(2|LittleLong)~
~\AssignDTMF(3|Long)~
~\AssignDTMF(*|RepeatQOne)~
First Question.
At your last visit to our service center, how long was the wait for your
vehicle to be serviced?
If your wait was nice and quick, please press one.
If you had a wait that was a little long, press two.
If you had a really long wait, press three.
To repeat the question, press star.
~\WaitForDTMF(10)~
~\Label(RepeatQOne)~
~\Goto(QuestionOne)~
~\Label(Quick)~
We are glad to hear that your wait was quick.
~\Goto(QuestionTwo)~
~\Label(LittleLong)~
We are sorry to hear that your wait was a little long.
~\Goto(QuestionTwo)~
~\Label(Long)~
We are really sorry to hear that you had a long wait.
~\Goto(QuestionTwo)~
~\Label(QuestionTwo)~
~\ClearDTMF()~
~\AssignDTMF(1|YesQTwo)~
~\AssignDTMF(2|No)~
~\AssignDTMF(*|RepeatQTwo)~
Question Two.
Was the staff at our service center courteous, and did they answer any questions you may have had?
Press one for Yes.
Press two for No.
To repeat the question, press star.
~\WaitForDTMF(10)~
~\Label(RepeatQTwo)~
~\Goto(QuestionTwo)~
~\Label(YesQTwo)~
We are proud to hear that our staff gave you good service.
~\Goto(QuestionThree)~
~\Label(No)~
We are sorry to hear that our staff did not give you the service you deserve.
~\Goto(QuestionThree)~
~\Label(QuestionThree)~
~\ClearDTMF()~
~\AssignDTMF(1|YesQThree)~
~\AssignDTMF(2|NoQThree)~
~\AssignDTMF(3|NotSure)~
~\AssignDTMF(*|RepeatQThree)~
Question Three.
Was your vehicle well taken care of by our staff members.
If Yes, press one.
If no, press two.
If you are not sure, press three.
To repeat the question, press star.
~\WaitForDTMF(10)~
~\Label(RepeatQThree)~
~\Goto(QuestionThree)~
~\Label(YesQThree)~
We are proud to know that your vehicle was well taken care of.
~\Goto(LastQuestion)~
~\Label(NoQThree)~
We are sorry that your vehicle was not taken care of.
~\Goto(LastQuestion)~
~\Label(NotSure)~
We hope that our staff took good care of your vehicle.
~\Goto(LastQuestion)~
~\Label(LastQuestion)~
~\ClearDTMF()~
~\AssignDTMF(1|YesLastQ)~
~\AssignDTMF(2|NoLastQ)~
~\AssignDTMF(*|RepeatLastQ)~
Last Question.
Do you plan on returning to our service center the next time your vehicle needs service.
For Yes, press One.
For No, press Two.
To repeat the question, press star.
~\WaitForDTMF(10)~
~\Label(RepeatLastQ)~
~\Goto(LastQuestion)~
~\Label(YesLastQ)~
We are proud to hear that you will continue to use our services.
Thank you for Participating in our survey. Have a great day.
~\EndCall()~
~\Label(NoLastQ)~
We are sorry to hear that you will no longer be using our services.
Thank you for participating in our survey. Have a great day.
~\EndCall()~
~\Label(Amd)~
Hello, this is Roger's Car Dealership calling to see if you would like to
participate in a survey regarding your last visit to our service center. If you
would like to participate in this survey, please give us a call at 0134357698.
Thank you.
~\EndCall()~

Record a Sound File

This example shows how to record a sound file by sending yourself a phone call.

~\SetVar(maxrecordseconds|300)~
~\AssignDTMF(2|ReRecord)~
~\PlaySpecialSoundFile(BEA78757-BE32-4670-A8F7-D7E03AAFFB95)~
Sound ID test
~\Label(ReRecord)~
~\PlaySpecialSoundFile(AAA31398-AED0-4854-B745-95D174AAFE37)~
~\PlaySpecialSoundFile(586fde68-70fa-49eb-b64c-e44d33ce0573)~
~\RecordAndSaveAs(test)~
~\AssignDTMF(1|End)~
~^test~
~\PlaySpecialSoundFile(C8F07A8C-E130-4E54-BE55-8079B8BB64E5)~
~\Label(End)~
~\PlaySpecialSoundFile(B8B80319-0308-4E9A-80D8-D3A3D1E3CF51)~

Let’s start sending, together.