DeviceBuilder

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

constructor

new DeviceBuilder()

Accessors

devices

get devices(): NestedArray<VoiceCallDeviceParams>

Returns

NestedArray<VoiceCallDeviceParams>

Methods

add

add(params): DeviceBuilder

Parameters

NameType
paramsVoiceCallDeviceParams | VoiceCallDeviceParams[]

Returns

DeviceBuilder


Phone

Static Phone(params): VoiceCallPhoneParams

Parameters

NameType
paramsVoiceCallDialPhoneMethodParams

Returns

VoiceCallPhoneParams


Sip

Static Sip(params): VoiceCallSipParams

Parameters

NameType
paramsVoiceCallDialSipMethodParams

Returns

VoiceCallSipParams