【问题标题】:Using TwiML to determine when outbound call is answered使用 TwiML 确定何时应答出站呼叫
【发布时间】:2015-05-23 06:46:04
【问题描述】:

我正在构建一个设置为调用用户的 TwiML 应用程序(Twilio 标记语言应用程序)。当我进行出站呼叫和呼叫结束时,我的服务器会从 Twilio API 接收适当的回调。但是,当最终用户接听电话时,我的服务器没有收到来自 Twilio 服务器的响应。这是我服务器上的内容:

response = Twilio::TwiML::Response.new do |r|
  r.Dial :callerId => our_number, :action => "/twilio/callback_response", :method => "POST", :statusCallbackEvent => ["answered"] do |d|
      # d.Number(CGI::escapeHTML number)
      d.Number("+1xxxxxxx")
      d.Number("+1xxxxxxx")
  end
end

:statusCallbackEvent 参数似乎没有按预期工作。

我的服务器是用 Rails 4.1.6 (Ruby 2.1.3) 编写的。我正在使用“twilio-ruby”宝石。我的 Gemfile 有 gem 'twilio-ruby, '4.2.0',这是 gem 的最新版本。

【问题讨论】:

    标签: ruby-on-rails ruby twilio twilio-twiml


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

    您不能使用 TwiML 和 <Dial> 动词为呼叫设置状态回调。

    如果您是自己拨打电话,您可以set the statusCallbackEvent parameter in the initial REST API call, as described in the documentation here。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-15
      • 1970-01-01
      • 2021-11-24
      相关资源
      最近更新 更多