You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Manage ACS SDK connectivity for incoming calls
47
+
### How to best manage SDK connectivity to Microsoft infrastructure
48
48
49
-
A`Call Agent` instance lets you start/join and manage incoming calls. Your `Call Agent` instance needs to be connected to ACS infrastructure to receive incoming calls. This connection is established when a `Call Agent` instance is created, but sometimes, for example when the network is unstable, the connection may not be set up, or it may break during the lifecycle of `Call Agent`. ACS SDK always tries to stay connected with ACS infrastructure. It keeps retrying to connect when the connection is lost.
49
+
The`Call Agent` instance lets you manage calls and join or start them. Your calling SDK needes to connect to Microsoft infrastructure to get notification of incoming calls and coordinate other call details. Sometimes the connection may fail be disconnected.
50
50
51
-
You can check if `Call Agent` is connected to ACS infra by looking at the current value of `connectionState` property and listening to `connectionStateChanged` event from `Call Agent`.
51
+
Your call `Call Agent` will be in 2 possible states:
52
+
53
+
**Connected** - A `Call Agent` connectionStatue value of `Connected` means the client SDK is connected and capable of receiving notifications from Microsoft infrastructure.
54
+
55
+
**Disconnected** - A `Call Agent` connectionStatue value of `Disconnected` means there is an issue that is preventing the SDK it from properly connecting. `Call Agent` should be re-created.
56
+
-`invalidToken`: If a token expired or it's invalid `Call Agent` instance will disconnect with this error.
57
+
-`connectionIssue`: If there is an issue with the client connecting to Microsoft infrascture, after many retries `Call Agent` will fail to re-connect and expose the `connectionIssue` error.
58
+
59
+
You can check if your local `Call Agent` is connected to Microsoft infrastrucue by inspecting the current value of `connectionState` property. During an active call you can listen to the `connectionStateChanged` event to determine if `Call Agent` changes from **Connected** to **Disconnected** state.
The above example illustrates how to manage connection state, whenever connection state is:
65
-
-`Connected` - `Call Agent` instance is connected and capable of receiving notification from ACS infra. For example, receiving incoming call notifications.
66
-
-`Disconnected` - `Call Agent` instance is disconnected. It is a terminal state. `Call Agent` should be re-created. Users should make sure it has no network problems.
67
-
-- reason `invalidToken` - if ACS token expired or it's invalid and application failed to provide new valid token. `Call Agent` instance will disconnect with this reason.
68
-
-- reason `connectionIssue` - if the network is down, and after many retries `Call Agent` fails to re-connect, it will disconnect with this reason. It usually indicates client network issues and can be re-stored as soon as the connectivity issue is resolved.
0 commit comments