你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Call Connection - Add Participant

将参与者添加到呼叫。

POST {endpoint}/calling/callConnections/{callConnectionId}/participants:add?api-version=2024-06-15-preview

URI 参数

名称 必需 类型 说明
callConnectionId
path True

string

呼叫连接 ID

endpoint
path True

string

url

Azure 通信资源的终结点。

api-version
query True

string

要调用的 API 版本。

请求头

名称 必需 类型 说明
Authorization True

string

Azure 通信服务用户访问令牌。

Repeatability-Request-ID

string

uuid

如果指定,客户端将指示请求可重复;也就是说,客户端可以使用相同的可重复性-Request-Id 多次发出请求并返回适当的响应,而无需服务器多次执行请求。 Repeatability-Request-Id 的值是表示请求的客户端生成的唯一标识符的不透明字符串。 它是版本 4 (随机) UUID。

Repeatability-First-Sent

string

date-time-rfc1123

如果指定了 Repeatability-Request-ID 标头,则还必须指定 Repeatability-First-Sent 标头。 该值应为首次创建请求的日期和时间,使用 IMF 修复日期形式的 HTTP 日期表示。 示例:1994年11月6日 08:49:37 GMT。

请求正文

名称 必需 类型 说明
participantToAdd True

CommunicationIdentifierModel

customCallingContext

CustomCallingContext

客户用来向目标发送自定义调用上下文

invitationTimeoutInSeconds

integer

获取或设置等待受邀参与者取件的超时。 此值的最大值为 180 秒

operationCallbackUri

string

设置一个回调 URI,用于替代 CreateCall/AnswerCall 为此操作设置的默认回调 URI。 此设置按操作。 如果未设置,将使用 CreateCall/AnswerCall 设置的默认回调 URI。

operationContext

string

客户在调用中调用操作时使用,以将请求与响应事件相关联。

sourceCallerIdNumber

PhoneNumberIdentifierModel

sourceDisplayName

string

(可选)添加 PSTN 参与者或团队用户时与此邀请操作关联的源的显示名称。 注意:不会更新名单中的显示名称。

响应

名称 类型 说明
202 Accepted

AddParticipantResponse

该服务已接受添加参与者请求,并开始处理它。 你将在指定的回调 URI 处收到 AddParticipantSucceeded 或 AddParticipantFailed 事件,以更新请求的状态。

Other Status Codes

CommunicationErrorResponse

错误

安全性

Authorization

Azure 通信服务用户访问令牌。

类型: apiKey
在: header

示例

CallConnection_AddParticipant

示例请求

POST https://contoso.communications.azure.com/calling/callConnections/18dea47f-b081-4107-9a5c-4300819d2c6c/participants:add?api-version=2024-06-15-preview

{
  "participantToAdd": {
    "kind": "communicationUser",
    "communicationUser": {
      "id": "8:acs:b9614373-fd0b-480c-8fd2-cb58b70eab9f_ae9e3307-f56e-44be-8934-80a63f080538"
    }
  },
  "operationContext": "adding participant",
  "sourceCallerIdNumber": {
    "value": "+18440123456"
  },
  "operationCallbackUri": "https://app.contoso.com/callback"
}

示例响应

{
  "operationContext": "adding participant",
  "participant": {
    "identifier": {
      "kind": "communicationUser",
      "communicationUser": {
        "id": "8:acs:b9614373-fd0b-480c-8fd2-cb58b70eab9f_ae9e3307-f56e-44be-8934-80a63f080538"
      }
    },
    "isMuted": false
  },
  "invitationId": "7b4244f8-d2ff-46d1-a629-4f9fb5f73d40"
}

定义

名称 说明
AddParticipantRequest

将参与者添加到呼叫的请求有效负载。

AddParticipantResponse

用于将参与者添加到呼叫的响应有效负载。

CallParticipant

呼叫参与者。

CustomCallingContext

将发送到目标的自定义调用上下文

AddParticipantRequest

将参与者添加到呼叫的请求有效负载。

名称 类型 说明
customCallingContext

CustomCallingContext

客户用来向目标发送自定义调用上下文

invitationTimeoutInSeconds

integer

获取或设置等待受邀参与者取件的超时。 此值的最大值为 180 秒

operationCallbackUri

string

设置一个回调 URI,用于替代 CreateCall/AnswerCall 为此操作设置的默认回调 URI。 此设置按操作。 如果未设置,将使用 CreateCall/AnswerCall 设置的默认回调 URI。

operationContext

string

客户在调用中调用操作时使用,以将请求与响应事件相关联。

participantToAdd

CommunicationIdentifierModel

sourceCallerIdNumber

PhoneNumberIdentifierModel

sourceDisplayName

string

(可选)添加 PSTN 参与者或团队用户时与此邀请操作关联的源的显示名称。 注意:不会更新名单中的显示名称。

AddParticipantResponse

用于将参与者添加到呼叫的响应有效负载。

名称 类型 说明
invitationId

string

用于添加参与者的邀请 ID。

operationContext

string

客户端提供的操作上下文。

participant

CallParticipant

通话中当前参与者的列表。

CallParticipant

呼叫参与者。

名称 类型 说明
identifier

CommunicationIdentifierModel

isMuted

boolean

参与者静音

isOnHold

boolean

是被保留的参与者。

CustomCallingContext

将发送到目标的自定义调用上下文

名称 类型 说明
sipHeaders

object

自定义调用上下文 SIP 标头

voipHeaders

object

自定义调用上下文 VoiP 标头