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.
Constructors
constructor
• new DeviceBuilder()
Instantiates an empty DeviceBuilder. Use the add method to add devices to this DeviceBuilder.
Example
Properties
devices
Get the list of devices that have been added to this DeviceBuilder.
Syntax: DeviceBuilder.devices()
Returns: NestedArray<Object>
Methods
add
▸ add(device): DeviceBuilder
Adds the specified device (or set of devices) in series to this DeviceBuilder. When you add a device in series, a call to that device will be made only if none of the previously added devices answer the call.
You can pass either a device (Phone or Sip) or an array of devices.
- Passing a single device will add that device in series to the sequence.
- Passing an array of devices will add those devices in series to the previous ones, but among themselves they will be called in parallel.
Parameters
Returns
Example
Adding two devices in series. If "+xxxxxx" doesn’t answer within 30 seconds, "+yyyyyy" will be called.
Adding two devices in parallel. Both will ring simultaneously. As soon as
either "+xxxxxx" or "+yyyyyy" answers, the other stops ringing.
Mixing series and parallel. First calls the SIP device. If it doesn’t
answer, calls "+yyyyyy" and "+zzzzzz" simultaneously.
Phone
▸ Static Phone(params): Object
Represents the configuration to call a phone device.
Parameters
Returns
Object
Example
Sip
▸ Static Sip(params): Object
Represents the configuration to call a SIP device.
Parameters
Returns
Object