Share via


CallClientState interface

Container for all of the state data proxied by StatefulCallClient. The calls, callsEnded, incomingCalls, and incomingCallsEnded states will be automatically provided if a callAgent has been created. The deviceManager will be empty initially until populated see DeviceManagerState. The userId state is provided as a convenience for the developer and is completely controled and set by the developer.

Properties

alternateCallerId

A phone number in E.164 format that will be used to represent callers identity. For example, using the alternateCallerId to add a participant using PSTN, this number will be used as the caller id in the PSTN call.

callAgent

Proxy of <xref:%40azure%2Fcommunication-calling%23CallAgent>. Please review CallAgentState.

calls

Proxy of <xref:%40azure%2Fcommunication-calling%23CallAgent.calls> as an object with CallState CallState fields. It is keyed by <xref:%40azure%2Fcommunication-calling%23Call.id>. Please note that <xref:%40azure%2Fcommunication-calling%23Call.id> could change. You should not cache the id itself but the entire <xref:%40azure%2Fcommunication-calling%23Call> and then use the id contained to look up data in this map.

callsEnded

Calls that have ended are stored here so the callEndReason could be checked. It is an object with <xref:%40azure%2Fcommunication-calling%23Call.id> keys and CallState values.

Only <xref:MAX_CALL_HISTORY_LENGTH> Calls are kept in the history. Oldest calls are evicted if required.

deviceManager

Proxy of <xref:%40azure%2Fcommunication-calling%23DeviceManager>. Please review DeviceManagerState.

environmentInfo

state to track the environment that the stateful client was made in is supported

incomingCalls

Proxy of <xref:%40azure%2Fcommunication-calling%23IncomingCall> as an object with <xref:IncomingCall> fields. It is keyed by <xref:%40azure%2Fcommunication-calling%23IncomingCall.id>.

incomingCallsEnded

Incoming Calls that have ended are stored here so the callEndReason could be checked. It is an as an object with <xref:%40azure%2Fcommunication-calling%23Call.id> keys and <xref:IncomingCall> values.

Only <xref:MAX_CALL_HISTORY_LENGTH> Calls are kept in the history. Oldest calls are evicted if required.

latestErrors

Stores the latest error for each API method.

See documentation of {@Link CallErrors} for details.

latestNotifications

Stores the latest notifications.

See documentation of {@Link CallNotifications} for details.

userId

Stores a userId. This is not used by the StatefulCallClient and is provided here as a convenience for the developer for easier access to userId. Must be passed in at initialization of the StatefulCallClient. Completely controlled by the developer.

Property Details

alternateCallerId

A phone number in E.164 format that will be used to represent callers identity. For example, using the alternateCallerId to add a participant using PSTN, this number will be used as the caller id in the PSTN call.

alternateCallerId?: string

Property Value

string

callAgent

Proxy of <xref:%40azure%2Fcommunication-calling%23CallAgent>. Please review CallAgentState.

callAgent?: CallAgentState

Property Value

calls

Proxy of <xref:%40azure%2Fcommunication-calling%23CallAgent.calls> as an object with CallState CallState fields. It is keyed by <xref:%40azure%2Fcommunication-calling%23Call.id>. Please note that <xref:%40azure%2Fcommunication-calling%23Call.id> could change. You should not cache the id itself but the entire <xref:%40azure%2Fcommunication-calling%23Call> and then use the id contained to look up data in this map.

calls: {[key: string]: CallState}

Property Value

{[key: string]: CallState}

callsEnded

Calls that have ended are stored here so the callEndReason could be checked. It is an object with <xref:%40azure%2Fcommunication-calling%23Call.id> keys and CallState values.

Only <xref:MAX_CALL_HISTORY_LENGTH> Calls are kept in the history. Oldest calls are evicted if required.

callsEnded: {[key: string]: CallState}

Property Value

{[key: string]: CallState}

deviceManager

Proxy of <xref:%40azure%2Fcommunication-calling%23DeviceManager>. Please review DeviceManagerState.

deviceManager: DeviceManagerState

Property Value

environmentInfo

state to track the environment that the stateful client was made in is supported

environmentInfo?: EnvironmentInfo

Property Value

incomingCalls

Proxy of <xref:%40azure%2Fcommunication-calling%23IncomingCall> as an object with <xref:IncomingCall> fields. It is keyed by <xref:%40azure%2Fcommunication-calling%23IncomingCall.id>.

incomingCalls: {[key: string]: IncomingCallState | TeamsIncomingCallState}

Property Value

incomingCallsEnded

Incoming Calls that have ended are stored here so the callEndReason could be checked. It is an as an object with <xref:%40azure%2Fcommunication-calling%23Call.id> keys and <xref:IncomingCall> values.

Only <xref:MAX_CALL_HISTORY_LENGTH> Calls are kept in the history. Oldest calls are evicted if required.

incomingCallsEnded: {[key: string]: IncomingCallState | TeamsIncomingCallState}

Property Value

latestErrors

Stores the latest error for each API method.

See documentation of {@Link CallErrors} for details.

latestErrors: CallErrors

Property Value

latestNotifications

Stores the latest notifications.

See documentation of {@Link CallNotifications} for details.

latestNotifications: CallNotifications

Property Value

userId

Stores a userId. This is not used by the StatefulCallClient and is provided here as a convenience for the developer for easier access to userId. Must be passed in at initialization of the StatefulCallClient. Completely controlled by the developer.

userId: CommunicationIdentifierKind

Property Value