This Twilio Function is based on the undocumented Twimlet of the same name
(whisper.php
).
It can be used as a drop-in replacement for the Twimlet, by using the URL of the Twilio Function as a webhook with the same GET parameters.
Alternatively, it can be customized by setting properties in the environment. GET and POST parameters are considered first, if provided, then environment properties, then config properties declared in the script.
Environment properties are most convenient when you are using a single instance of this script in your account. To customize multiple instances, the recommended way is to modify the script parameters in the config object, directly in the script.
The Whisper Funlet has two stages:
Stage | Addressing | Description |
---|---|---|
1 | Recipient | Ask recipient to press a key to accept the call |
2 | Recipient | Bridge the call when a digit has been pressed |
These two stages would typically be implemented in two separate Twilio Functions. In the Whisper Funlet, they are running in two separate instances of the same Twilio Function. This is in line with the original Whisper Twimlet, which implemented both stages in the same script.
Text string, a recording URL or a text to say. (A string starting with 'http' is considered to be a URL)
- Event:
Message
parameter - Environment:
FUNLET_WHISPER_MESSAGE
environment property - Script:
message
config property
Text string, language code for text messages, e.g. 'en' or 'en-gb'. Defaults to 'en': English with an American accent.
- Event:
Language
parameter - Environment:
FUNLET_WHISPER_LANGUAGE
environment property - Script:
language
config property
Text string, voice for text messages, one of 'man', 'woman' or 'alice'. Defaults to 'alice', who speaks in a large selection languages.
- Event:
Voice
parameter - Environment:
FUNLET_WHISPER_VOICE
environment property - Script:
voice
config property
Boolean, defaults to false. Whether to request the recipient to press a key to accept the call explicitly.
- Event:
HumanCheck
parameter - Environment:
FUNLET_WHISPER_HUMAN_CHECK
environment property - Script:
humanCheck
config property
Text string, list of digits pressed.
- Event:
Digits
property provided by<Gather>
This Twilio Function returns TwiML instructions for Twilio Voice.