将 'voiceReceiveMode' 更改为传真无效

Changing 'voiceReceiveMode' to fax is not working

我正在尝试使用 Twilio 购买传真号码并相应地设置其 webhooks。

$number = $twilio->incomingPhoneNumbers
       ->create([
             "voiceReceiveMode" => 'fax', 

             // also tried "VoiceReceiveMode" => 'fax',

             "voiceUrl" => "http://example.com",
             "phoneNumber" => $request->number,
             "voiceMethod" => "POST"
      ]
);

使用此代码,我可以购买号码,将语音方法设置为 post 还可以设置语音 url。


我已经设置了 voiceUrl,因为在文档中它说:

"At this point, the number's VoiceUrl will now behave as its FaxUrl". as mentioned here

但是 voiceReveiveMode 没有变化,始终保持在 "Voice"

此外,如果我 dd($number),在 IncomingPhoneNumberInstance 对象的属性下,我看不到 voiceReceiveMode

IncomingPhoneNumberInstance {#249 ▼
  #_assignedAddOns: null
  #version: V2010 {#244 ▶}
  #context: null
  #properties: array:30 [▼
    "accountSid" => "**"
    "addressSid" => null
    "addressRequirements" => "none"
    "apiVersion" => "2010-04-01"
    "beta" => false
    "capabilities" => array:4 [▶]
    "dateCreated" => DateTime {#250 ▶}
    "dateUpdated" => DateTime {#251 ▶}
    "friendlyName" => "(218) 963-5608"
    "identitySid" => null
    "phoneNumber" => "+12189635608"
    "origin" => "twilio"
    "sid" => "**"
    "smsApplicationSid" => ""
    "smsFallbackMethod" => "POST"
    "smsFallbackUrl" => ""
    "smsMethod" => "POST"
    "smsUrl" => ""
    "statusCallback" => ""
    "statusCallbackMethod" => "POST"
    "trunkSid" => null
    "uri" => "/2010-04-01/Accounts/ACcc7e0c85b66b0414485f08a1e03abdba/IncomingPhoneNumbers/PNe2bd51168e719b86cee6c9c46074e46c.json"
    "voiceApplicationSid" => null
    "voiceCallerIdLookup" => false
    "voiceFallbackMethod" => "POST"
    "voiceFallbackUrl" => null
    "voiceMethod" => "POST"
    "voiceUrl" => "http://example.app"
    "emergencyStatus" => "Inactive"
    "emergencyAddressSid" => null
  ]

此处为 Twilio 开发人员布道师。

在与 Twilio 的传真团队交谈后发现,目前您无法在购买时为 phone 号码设置 VoiceReceiveMode。从技术上讲,这是 PHP 库中的一个限制,允许您尝试设置该参数(我在 Ruby 中尝试过,但这是不可能的)。但是,最终这是 API 中的一个错误,因为它不允许这样做。

目前,我建议您在购买号码并获得其 SID 后使用另一个 API 调用来更新号码的 VoiceReceiveMode

同时,我们正在考虑更新 API 以在您购买时接受此参数。当我们发货时,我会努力更新这个答案。