Types
Helper types.
CollectDigitsConfig
A configuration object to specify how to collect digits.
Object containing the digit collection configuration.
Max number of digits to collect.
Timeout in seconds between each digit.
DTMF digits that will end the collection.
Example
Collecting digits using call.collect():
Prompting for digits with TTS using call.promptTTS():
CollectSpeechConfig
A configuration object to specify how to collect speech.
Object containing the speech collection configuration.
How much silence to wait for end of speech in seconds.
Maximum time to collect speech in seconds.
Language to detect. Supported languages here.
Array of expected phrases to detect.
Enable enhanced speech recognition at an additional cost. Accepted values are enhanced, enhanced.phone_call, or enhanced.video. The value enhanced will automatically detect whether to optimize with the phone_call or video setting.
Example
Collecting speech using call.collect():
Prompting for speech with TTS using call.promptTTS():
SipCodec
A codec for SIP. Possible values are: "PCMU", "PCMA", "OPUS", "G729", "G722", "VP8", "H264".
Example
Using codecs when dialing a SIP endpoint with Voice.DeviceBuilder.Sip():
SipHeader
A header for SIP. It is an object with the following properties.
Properties
Name of the header.
Value of the header.
Example
Using custom headers when dialing a SIP endpoint with Voice.DeviceBuilder.Sip():
RingtoneName
The name of a ringtone, based on country-specific ring patterns.
Example
Playing a ringtone with Voice.Playlist.Ringtone():
Prompting with a ringtone using call.promptRingtone():
VoiceCallPhoneParams
A device configuration object for calling a phone number. Returned by Voice.DeviceBuilder.Phone() and passed to DeviceBuilder.add().
Properties
The device type. Always "phone" for phone devices.
Number to call, in E.164 format.
SignalWire number to use to initiate the call, in E.164 format.
Time to wait for the call to be answered, in seconds.
Webhook URL to which SignalWire will send call status change notifications. See CallState.
Array of event names to be notified about. Allowed values are created, ringing, answered, and ended.
VoiceCallSipParams
A device configuration object for calling a SIP endpoint. Returned by Voice.DeviceBuilder.Sip() and passed to DeviceBuilder.add().
Properties
The device type. Always "sip" for SIP devices.
SIP endpoint URI to call.
SIP endpoint URI to use to initiate the call.
Time to wait for the call to be answered, in seconds.
Array of desired codecs in order of preference. See SipCodec.
Array of headers. Must be X- headers only. See SipHeader.
Webhook URL to which SignalWire will send call status change notifications. See CallState.
Array of event names to be notified about. Allowed values are created, ringing, answered, and ended.
Whether to use WebRTC media.
Session timeout in seconds.
TapDevice
A device to use as a destination for tap.
This can be either an RTP device or a WebSocket device.
Properties
Type of this device (RTP or WebSocket).
RTP (type = "rtp")
An RTP device has the following properties in addition to the general ones:
RTP IPv4 address.
RTP port.
Optional codec to use. It will be the same as the tapped audio if not set.
Optional sample rate in Hz. It will be the same as the tapped audio if not set.
Optional packetization time in milliseconds. It will be the same as the tapped audio if not set.
WebSocket (type = "ws")
A WebSocket device has the following properties in addition to the general ones:
Destination URI.
Optional codec to use. It will be the same as the tapped audio if not set.
Optional sample rate in Hz. It will be the same as the tapped audio if not set.
Example
Tapping audio to a WebSocket endpoint using call.tapAudio():
Tapping audio to an RTP endpoint using call.tap():