{state.transferPending ?"Transferring…":"Transfer to support"}
</button>
);
}
Client method
Behavior
connect(config): Promise<void>
Resolves on registration; rejects on timeout/failure
disconnect(), dispose()
End calls, unregister, stop audio, release devices
call(target, caller?): Promise<void>
Validate target, request microphone, dial
answer(): Promise<void>, hangup()
Answer or decline/cancel/end the call
setMuted(boolean), setHeld(boolean)
Mute or hold/resume an established call
sendDTMF(tone)
Send one digit, *, #, or A–D
transfer(target)
Blind REFER transfer; keeps the call until success NOTIFY
testMicrophone(): Promise<void>
Permission preflight; immediately releases its stream
setInputDevice(id)
Select the next call’s microphone; blocked during a call
setOutputDevice(id): Promise<void>
Change output where setSinkId is supported
setVolume(0…1), playAudio()
Playback level and autoplay recovery
clearError(), clearHistory()
Clear recoverable error or session history
getSnapshot(), subscribe(listener)
Headless external-store API
simulateIncoming(caller)
Available only when explicitly constructed in preview mode
Promises reject for errors and synchronous actions can throw; handle them in your host UI. Errors also appear in state.error. Host callback exceptions are isolated so they cannot interrupt cleanup. If you supply an external client to PhoneProvider, you own its disposal. historyLimit is configurable on new PhoneClient({ historyLimit: 25 }) (default: 50).
Update cue preset, volume, per-event toggles, and haptics
previewTone(event)
Play one cue cycle while the line is idle
playKeypadTone(digit)
Local key feedback only; does not send SIP DTMF
useCallActivity() exposes call state, input/output levels, and normalized frequency bands for custom visuals. Use PhoneProvider once per line; mounting multiple all-in-one phones creates independent connections.