ruby - 是否可以在 RingOut 中将主叫方 ID (CID/CLID) 设置为“阻止”?

标签 ruby ringcentral ringout caller-id

我正在使用 RingCentral RingOut API,我想知道是否可以阻止 caller ID

RingOut API 仅在请求格式中显示 phoneNumber 属性,但 RingCentral 在线帐户门户可以阻止调用者 ID。有办法做到这一点吗?

API引用:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefMakeRingOut

请求:

POST /restapi/v1.0/account/~/extension/~/ring-out HTTP/1.1

{
    "from": {"phoneNumber": "+14155550100"},
    "callerId": {"phoneNumber": "+16505550100"},
    "to": {"phoneNumber": "+12125550100"},
    "playPrompt": true
}

我正在使用 Ruby SDK:https://github.com/ringcentral/ringcentral-ruby

rc.post('/restapi/v1.0/account/~/extension/~/ring-out', payload: {
  from: {phoneNumber: "+14155550100"},
  callerId: {phoneNumber: "+16505550100"},
  to: {phoneNumber: "+12125550100"},
  playPrompt: true
})

最佳答案

您可以通过将分机的默认 RingOut 主叫方 ID 设置设置为“已阻止”,然后在没有显式 callerId 值的情况下进行 RingOut 调用来实现此目的,因此默认值将使用。您需要在调用 RingOut API 之前单独更新分机来电显示设置。目前无法在 RingOut API 调用本身中将主叫方 ID 设置为阻止。

要将帐户中的来电显示设置为已阻止,请使用更新来电显示 API:

API引用:https://developer.ringcentral.com/api-docs/latest/index.html#!#RefUpdateCallerId

以下是一些使用 HTTP 和 Ruby SDK 的示例:

通过 HTTP 更新来电显示 API

PUT /restapi/v1.0/account/~/extension/~/caller-id
Authorization: Bearer <myAccessToken>

{
  "byFeature": [
    {
      "feature": "RingOut",
      "callerId": {
        "type": "Blocked"
      }
    }
  ]
}

通过 Ruby SDK 更新来电显示 API

使用ringcentral-ruby SDK :

rc.put('/restapi/v1.0/account/~/extension/~/caller-id', payload: {
  byFeature: [
    {
      feature: "RingOut",
      callerId: {
        type: "Blocked"
      }
    }
  ]
})

通过 Web UI 更新来电显示

您还可以使用在线帐户门户 ( https://service.ringcentral.com ) 更新此设置:

设置 > 出站电话/传真 > 来电显示 > 按功能 > 从网络拨出 > 编辑

RingCentral Update Caller ID

调用 RingOut 调用

当您进行 RingOut 调用时,只需省略 callerId 属性,它将使用阻止的值。

关于ruby - 是否可以在 RingOut 中将主叫方 ID (CID/CLID) 设置为“阻止”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50218436/

相关文章:

ruby-on-rails - 有没有一种简单的方法可以在 Passenger 的请求周期之外运行垃圾收集?

ruby - Bignum 太大而无法转换为 'long' (RangeError)

ruby-on-rails - 在 ruby​​ 中评估 SCSS (SASS) 模板(Rails 元素)

javascript - RingCentral JS SDK - 缺少刷新 token

javascript - 如何发起测试 RingOut 调用?

ruby-on-rails - 如何在 Ruby 中创建 Web 套接字客户端?

java - 使用 RingCentral API 添加新联系人

javascript - 如何使用 RingCentral 设置来电显示与区号匹配?

ringcentral - 如何通过 RingOut 使用 RingCentral API 上的扩展 ID