@dialstack/sdk-dev / webrtc/src / PhoneOptions
Interface: PhoneOptions
Defined in: sdk/webrtc/src/types.ts:13
Properties
apiBaseUrl?
optional apiBaseUrl?: string;
Defined in: sdk/webrtc/src/types.ts:15
audioInputDeviceId?
optional audioInputDeviceId?: string;
Defined in: sdk/webrtc/src/types.ts:81
Microphone deviceId for new calls; omitted means the OS default. Held for the
phone's lifetime and NOT persisted — remembering a device is the host's call, so
pass a saved value back in on construction (the React softphone does).
An id that no longer resolves falls back to the default rather than failing the call, since ids are origin-scoped and rotate.
audioOutputDeviceId?
optional audioOutputDeviceId?: string;
Defined in: sdk/webrtc/src/types.ts:86
Speaker deviceId for the ringback tone only; not persisted. Remote call audio
plays through a media element the host owns, and only its owner can route it.
autoReconnect?
optional autoReconnect?: boolean;
Defined in: sdk/webrtc/src/types.ts:31
createSignalingSocket?
optional createSignalingSocket?: SignalingSocketFactory;
Defined in: sdk/webrtc/src/types.ts:63
Opens the signaling WebSocket. Defaults to a bare new WebSocket(url, protocols). React Native supplies a variant that attaches a User-Agent
header (the signaling ingress 403s a handshake without one, and iOS's
WebSocket sends none by default); browsers forbid overriding it, so web uses
the default.
emergencyAddressId?
optional emergencyAddressId?: string;
Defined in: sdk/webrtc/src/types.ts:39
The emergency-address resource id (emerg_…) this softphone uses for E911.
Presented on the authenticate handshake so the server can bind
it to the current network. When omitted, a previously persisted id (see
setEmergencyAddress) is loaded from storage if available.
iceServers?
optional iceServers?: RTCIceServer[];
Defined in: sdk/webrtc/src/types.ts:32
onAppResume?
optional onAppResume?: AppResumeSubscribe;
Defined in: sdk/webrtc/src/types.ts:72
Subscribe to "the app/tab returned to the foreground". Defaults to the web
DOM lifecycle events (visibilitychange/focus/online/pageshow); React
Native has no document, so the RN softphone provider supplies an
AppState-backed variant here. On resume the transport actively re-verifies
the connection (a backgrounded tab's throttled event loop may never have
processed the socket's close), reconnecting if it's dead.
onTokenExpiring?
optional onTokenExpiring?: () => Promise<string>;
Defined in: sdk/webrtc/src/types.ts:30
Returns
Promise<string>
ringback?
optional ringback?: Ringback;
Defined in: sdk/webrtc/src/types.ts:55
Outbound ringback tone. Defaults to the WebAudio RingbackTone. React Native
has no AudioContext, so the RN softphone provider supplies an
InCallManager-backed implementation here. One instance is shared across
calls (outbound ringback plays one call at a time).
signalingBaseUrl?
optional signalingBaseUrl?: string;
Defined in: sdk/webrtc/src/types.ts:29
Base URL of the signaling server the phone opens its WebSocket to, e.g.
wss://webrtc.dialstack.ai. The signaling host is separate from
apiBaseUrl (the REST API) and is served by region-aware infrastructure,
so latency-based DNS routes each client to the nearest region
automatically — no client-side region selection is needed.
When omitted, it defaults to the standard signaling host derived from
apiBaseUrl (the api. hostname label becomes webrtc.). Override only
for self-hosting, staging, or a proxy. ws/wss and http/https are
accepted; http(s) is upgraded to ws(s). A trailing /v1/webrtc path
is appended automatically if absent.
storage?
optional storage?: PlatformStorage;
Defined in: sdk/webrtc/src/types.ts:48
Synchronous key/value store used to persist the selected E911 address id
across launches. Optional at this layer: it defaults to the platform seam's
store — localStorage on web, an in-memory (non-persisting) store on React
Native. On React Native the softphone provider requires the host to supply a
real store (e.g. an AsyncStorage- or MMKV-backed adapter), because the SDK
takes no persistence dependency of its own.
token
token: string;
Defined in: sdk/webrtc/src/types.ts:14