Types
Helper types.
CollectDigitsConfig
A configuration object to specify how to collect digits.
digits
Object containing the digit collection configuration.
max
Max number of digits to collect.
digitTimeout
Timeout in seconds between each digit.
terminators
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.
speech
Object containing the speech collection configuration.
endSilenceTimeout
How much silence to wait for end of speech in seconds.
speechTimeout
Maximum time to collect speech in seconds.
language
Language to detect. Supported languages here.
hints
Array of expected phrases to detect.
model
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
Name of the header.
value
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
type
The device type. Always "phone" for phone devices.
to
Number to call, in E.164 format.
from
SignalWire number to use to initiate the call, in E.164 format.
timeout
Time to wait for the call to be answered, in seconds.
callStateUrl
Webhook URL to which SignalWire will send call status change notifications. See CallState.
callStateEvents
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
type
The device type. Always "sip" for SIP devices.
to
SIP endpoint URI to call.
from
SIP endpoint URI to use to initiate the call.
timeout
Time to wait for the call to be answered, in seconds.
codecs
Array of desired codecs in order of preference. See SipCodec.
headers
Array of headers. Must be X- headers only. See SipHeader.
callStateUrl
Webhook URL to which SignalWire will send call status change notifications. See CallState.
callStateEvents
Array of event names to be notified about. Allowed values are created, ringing, answered, and ended.
webrtcMedia
Whether to use WebRTC media.
sessionTimeout
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
Type of this device (RTP or WebSocket).
RTP (type = "rtp")
An RTP device has the following properties in addition to the general ones:
addr
RTP IPv4 address.
port
RTP port.
codec
Optional codec to use. It will be the same as the tapped audio if not set.
rate
Optional sample rate in Hz. It will be the same as the tapped audio if not set.
ptime
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:
uri
Destination URI.
codec
Optional codec to use. It will be the same as the tapped audio if not set.
rate
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():