Voice.DeviceBuilder
A DeviceBuilder object allows you to specify a set of devices which should be dialed in sequence or parallel. You can then pass the device plan to the methods that support it, for example Call.connect.
Example
Creates a plan which specifies to dial a SIP endpoint. If there is no answer within 30 seconds, calls two phone numbers in parallel (as indicated by the array syntax). As soon as one of the two answers, the operation is considered successful.
const plan = new Voice.DeviceBuilder()
.add(Voice.DeviceBuilder.Sip({
from: 'sip:[email protected]',
to: 'sip:[email protected]',
timeout: 30,
}))
.add([
Voice.DeviceBuilder.Phone({ to: '+yyyyyy', timeout: 30 }),
Voice.DeviceBuilder.Phone({ to: '+zzzzzz', timeout: 30 })
])
Constructors
• new DeviceBuilder()
Accessors
• get
devices(): NestedArray
<VoiceCallDeviceParams
>
Returns
NestedArray
<VoiceCallDeviceParams
>
Methods
▸ add(params
): DeviceBuilder
Parameters
Name | Type |
---|---|
params | VoiceCallDeviceParams | VoiceCallDeviceParams [] |
Returns
▸ Static
Phone(params
): VoiceCallPhoneParams
Parameters
Name | Type |
---|---|
params | VoiceCallDialPhoneMethodParams |
Returns
VoiceCallPhoneParams
▸ Static
Sip(params
): VoiceCallSipParams
Parameters
Name | Type |
---|---|
params | VoiceCallDialSipMethodParams |
Returns
VoiceCallSipParams