CallClientState interface
StatefulCallClient代理的所有状态数据的容器。 如果已创建 callAgent,则会自动提供调用、callsEnded、incomingCalls 和 incomingCallsEnded 状态。 deviceManager 最初将为空,直到填充到 DeviceManagerState。 userId 状态作为开发人员的便利提供,由开发人员完全控制并设置。
属性
| alternate |
E.164 格式的电话号码,将用于表示呼叫者身份。 例如,使用 alternateCallerId 添加使用 PSTN 的参与者,此号码将用作 PSTN 呼叫中的呼叫方 ID。 |
| call |
<xref:%40azure%2Fcommunication-calling%23CallAgent>代理。 请查看 CallAgentState。 |
| calls | <xref:%40azure%2Fcommunication-calling%23CallAgent.calls> 代理作为具有 CallState CallState 字段的对象。 它由 <xref:%40azure%2Fcommunication-calling%23Call.id>键。 请注意,<xref:%40azure%2Fcommunication-calling%23Call.id> 可能会更改。 不应缓存 ID 本身,但应缓存整个 <xref:%40azure%2Fcommunication-calling%23Call>,然后使用包含的 ID 来查找此映射中的数据。 |
| calls |
已结束的调用存储在此处,以便检查 callEndReason。 它是一个具有 <xref:%40azure%2Fcommunication-calling%23Call.id> 键和 CallState 值的对象。 只有 <xref:MAX_CALL_HISTORY_LENGTH> 呼叫保留在历史记录中。 如果需要,将逐出最早的调用。 |
| device |
<xref:%40azure%2Fcommunication-calling%23DeviceManager>代理。 请查看 DeviceManagerState。 |
| environment |
state 来跟踪创建有状态客户端的环境 |
| incoming |
将 <xref:%40azure%2Fcommunication-calling%23IncomingCall> 代理作为具有 <xref:IncomingCall> 字段的对象。 它由 <xref:%40azure%2Fcommunication-calling%23IncomingCall.id>键。 |
| incoming |
已结束的传入呼叫存储在此处,以便检查 callEndReason。 它是一个具有 <xref:%40azure%2Fcommunication-calling%23Call.id> 键和 <xref:IncomingCall> 值的对象。 只有 <xref:MAX_CALL_HISTORY_LENGTH> 呼叫保留在历史记录中。 如果需要,将逐出最早的调用。 |
| latest |
存储每个 API 方法的最新错误。 有关详细信息,请参阅 {@Link CallErrors} 的文档。 |
| latest |
存储最新通知。 有关详细信息,请参阅 {@Link CallNotifications} 的文档。 |
| user |
存储 userId。 StatefulCallClient 不使用此功能,此处提供了方便开发人员更轻松地访问 userId。 必须在初始化 StatefulCallClient时传入。 完全由开发人员控制。 |
属性详细信息
alternateCallerId
E.164 格式的电话号码,将用于表示呼叫者身份。 例如,使用 alternateCallerId 添加使用 PSTN 的参与者,此号码将用作 PSTN 呼叫中的呼叫方 ID。
alternateCallerId?: string
属性值
string
callAgent
<xref:%40azure%2Fcommunication-calling%23CallAgent>代理。 请查看 CallAgentState。
callAgent?: CallAgentState
属性值
calls
<xref:%40azure%2Fcommunication-calling%23CallAgent.calls> 代理作为具有 CallState CallState 字段的对象。 它由 <xref:%40azure%2Fcommunication-calling%23Call.id>键。 请注意,<xref:%40azure%2Fcommunication-calling%23Call.id> 可能会更改。 不应缓存 ID 本身,但应缓存整个 <xref:%40azure%2Fcommunication-calling%23Call>,然后使用包含的 ID 来查找此映射中的数据。
calls: {[key: string]: CallState}
属性值
{[key: string]: CallState}
callsEnded
deviceManager
<xref:%40azure%2Fcommunication-calling%23DeviceManager>代理。 请查看 DeviceManagerState。
deviceManager: DeviceManagerState
属性值
environmentInfo
incomingCalls
将 <xref:%40azure%2Fcommunication-calling%23IncomingCall> 代理作为具有 <xref:IncomingCall> 字段的对象。 它由 <xref:%40azure%2Fcommunication-calling%23IncomingCall.id>键。
incomingCalls: {[key: string]: IncomingCallState | TeamsIncomingCallState}
属性值
{[key: string]: IncomingCallState | TeamsIncomingCallState}
incomingCallsEnded
已结束的传入呼叫存储在此处,以便检查 callEndReason。 它是一个具有 <xref:%40azure%2Fcommunication-calling%23Call.id> 键和 <xref:IncomingCall> 值的对象。
只有 <xref:MAX_CALL_HISTORY_LENGTH> 呼叫保留在历史记录中。 如果需要,将逐出最早的调用。
incomingCallsEnded: {[key: string]: IncomingCallState | TeamsIncomingCallState}
属性值
{[key: string]: IncomingCallState | TeamsIncomingCallState}
latestErrors
latestNotifications
存储最新通知。
有关详细信息,请参阅 {@Link CallNotifications} 的文档。
latestNotifications: CallNotifications
属性值
userId
存储 userId。 StatefulCallClient 不使用此功能,此处提供了方便开发人员更轻松地访问 userId。 必须在初始化 StatefulCallClient时传入。 完全由开发人员控制。
userId: CommunicationIdentifierKind