Call
Methods
iceRestart(completion:)
- Parameter completion: Callback indicating success or failure of the ICE restart
Parameters
| Name | Description |
|---|---|
| completion | Callback indicating success or failure of the ICE restart |
hangup()
Example:
call.hangup()answer(customHeaders:debug:)
Examples:
- Parameters:
- customHeaders: (optional) Custom Headers to be passed over webRTC Messages.
Headers should be in the format
X-key:ValuewhereX-prefix is required for custom headers. When calling AI Agents, headers with theX-prefix will be mapped to dynamic variables (e.g.,X-Account-Numberbecomes{{account_number}}). Hyphens in header names are converted to underscores in variable names. - debug: (optional) Enable debug mode for call quality metrics and WebRTC statistics.
When enabled, real-time call quality metrics will be available through the
onCallQualityChangecallback.
- customHeaders: (optional) Custom Headers to be passed over webRTC Messages.
Headers should be in the format
Parameters
| Name | Description |
|---|---|
| customHeaders | (optional) Custom Headers to be passed over webRTC Messages. Headers should be in the format X-key:Value where X- prefix is required for custom headers. When calling AI Agents, headers with the X- prefix will be mapped to dynamic variables (e.g., X-Account-Number becomes {{account_number}}). Hyphens in header names are converted to underscores in variable names. |
| debug | (optional) Enable debug mode for call quality metrics and WebRTC statistics. When enabled, real-time call quality metrics will be available through the onCallQualityChange callback. |
dtmf(dtmf:)
- Parameter dtmf: A string containing a single DTMF character. Valid characters are:
- Digits: 0-9
- Special characters: * (asterisk), # (pound)
- Letters: A-D (less commonly used)
Examples:
Parameters
| Name | Description |
|---|---|
| dtmf | A string containing a single DTMF character. Valid characters are: |
muteAudio()
Example:
call.muteAudio()unmuteAudio()
Example:
call.unmuteAudio()resetAudioDevice()
- AudioDeviceModule buffers stretch under poor network conditions
- WebRTC audio pacing causes frame accumulation
- iOS AudioUnit/AVAudioSession remains in large buffer state
Example:
call.resetAudioDevice()hold()
Example:
call.hold()unhold()
Example:
call.unhold()toggleHold()
active and held state of the call.