UNPKG

@signalwire/realtime-api

Version:
34 lines 1.48 kB
import type { VoiceDeviceBuilder, VoiceCallDeviceParams, VoiceCallPhoneParams, VoiceCallDialPhoneMethodParams, VoiceCallSipParams, VoiceCallDialSipMethodParams } from '@signalwire/core'; /** * 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 {@link 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. * * ```js * const plan = new Voice.DeviceBuilder() * .add(Voice.DeviceBuilder.Sip({ * from: 'sip:user1@domain.com', * to: 'sip:user2@domain.com', * timeout: 30, * })) * .add([ * Voice.DeviceBuilder.Phone({ to: '+yyyyyy', timeout: 30 }), * Voice.DeviceBuilder.Phone({ to: '+zzzzzz', timeout: 30 }) * ]) * ``` */ export declare class DeviceBuilder implements VoiceDeviceBuilder { private _devices; get devices(): import("@signalwire/core").NestedArray<VoiceCallDeviceParams>; add(params: VoiceCallDeviceParams | VoiceCallDeviceParams[]): this; static Phone(params: VoiceCallDialPhoneMethodParams): VoiceCallPhoneParams; static Sip(params: VoiceCallDialSipMethodParams): VoiceCallSipParams; } //# sourceMappingURL=DeviceBuilder.d.ts.map