What happens by default
networkEvents reports each step. See Network events.
Reconnect policy
Signature
Each attempt must be registered within 10 seconds, or it counts as failed. After giving up,
connectionState is failed and errorEvents emits reconnect_failed. The SDK tries again on the next network change, or when you call client.reconnect(), for example from a Retry button.
SdkConfig(autoReconnect: false) to handle reconnection yourself.
Keep-alive
Signature
Network watching and foreground re-registration
SdkConfig.watchNetwork(defaulttrue) watches Wi-Fi, mobile, and offline throughconnectivity_plus, so the SDK reacts at once instead of waiting for the keep-alive.SdkConfig.reregisterOnForeground(defaulttrue) registers again each time the app returns to the foreground. On a live connection this is one REGISTER on the same connection, and a call in progress isn’t touched. A dead connection is reconnected at once. Resumes within 2 seconds of each other count as one.
Calls during a network drop
When the connection drops during a connected or held call:- The call stays up for up to 12 seconds.
callEventsre-emits the call’s state withreason: 'reconnecting'. - The SDK reconnects and re-registers. Once it is registered, it restarts the call’s audio path on the new network (an ICE restart in a SIP re-INVITE) and emits the state again with
reason: 'reconnected'. - If the network isn’t back within 12 seconds, the call ends with reason
network_lost.
makeCall throws StateError('No network connection').
BYE or CANCEL is sent again after the SDK reconnects: up to 3 times, within 5 minutes, as the same user. The other side isn’t left on a silent call.
An outage longer than 12 seconds ends the call on the app side, and the
BYE follows when the app reconnects. If the app never reconnects, Vobiz ends the call on its side after a media timeout.STUN and TURN
Call audio uses WebRTC, which needs to find a network path to Vobiz’s media servers. By default the SDK uses Google’s public STUN server, which works on most networks. Behind strict corporate firewalls or symmetric NAT, add your own TURN server.Signature
TurnServers.withFallbacks builds the TURN entries for UDP, TCP, and TLS on port 443 in one call, so calls also work on networks that block everything but HTTPS:
Signature
Microphone settings
Signature