Skip to main content

Types

Helper types.

CollectDigitsConfig

A configuration object to specify how to collect digits.

NameTypeDescription
digitsObject-
digits.maxnumberMax number of digits to collect.
digits.digitTimeout?numberTimeout in seconds between each digit.
digits.terminators?stringDTMF digits that will end the collection. Default not set.

Example

{
max: 5,
digitTimeout: 3,
terminators: "#*"
}

CollectSpeechConfig

A configuration object to specify how to collect speech.

NameTypeDescription
speechObject-
speech.endSilenceTimeout?numberHow much silence to wait for end of speech. Default to 1 second.
speech.speechTimeout?numberMaximum time to collect speech. Default to 60 seconds.
speech.language?numberLanguage to detect. Default to "en-US". Supported languages here
speech.hints?string[]Array of expected phrases to detect.
speech.model?stringEnable 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

{
endSilenceTimeout: 1,
speechTimeout: 60,
language: "en-US",
hints: ["one", "two", "three", "four", "five"]
}

SipCodec

A codec for SIP. Possible values are: "PCMU", "PCMA", "OPUS", "G729", "G722", "VP8", "H264".

Example

"OPUS";

SipHeader

A header for SIP. It is an object with the following properties.

Properties

NameTypeDescription
namestringName of the header
valuestringValue of the header

Example

{ name: "X-Header-Name", value: "test" }

RingtoneName

The name of a ringtone. Possible values are: 'at', 'au', 'bg', 'br', 'be', 'ch', 'cl', 'cn', 'cz', 'de', 'dk', 'ee', 'es', 'fi', 'fr', 'gr', 'hu', 'il', 'in', 'it', 'lt', 'jp', 'mx', 'my', 'nl', 'no', 'nz', 'ph', 'pl', 'pt', 'ru', 'se', 'sg', 'th', 'uk', 'us', 'tw', 've', 'za'.

Example

"it";

TapDevice

A device to use as a destination for tap. This can be either an RTP device or a WebSocket device.

Properties

NameTypeDescription
type"rtp" | "ws"Type of this device (RTP or WebSocket).
...See below for the additional properties for each device type.

RTP (type = "rtp")

An RTP device has the following properties in addition to the general ones:

NameTypeDescription
addrstringRTP IPv4 address.
portstringRTP port.
codec"OPUS" | "PCMA" | "PCMU" | undefinedOptional codec to use. It will be the same as the tapped audio if not set.
ratenumber?Optional sample rate in Hz. It will be the same as the tapped audio if not set.
ptimenumber?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:

NameTypeDescription
uristringDestination URI.
codec"OPUS" | "PCMA" | "PCMU" | undefinedOptional codec to use. It will be the same as the tapped audio if not set.
ratenumber?Optional sample rate in Hz. It will be the same as the tapped audio if not set.

Example

An RTP device:

{
type: "rtp",
addr: "192.0.2.1",
port: "1234"
}

A WebSocket device:

{
type: "ws",
uri: "wss://example.domain.com/endpoint",
}