用于Twilio双向短信的Ruby api不起作用

时间:2017-07-11 04:12:39

标签: ruby twilio twiml

以下是twilio短信双向消息的webhook。 每当我从手机回复短信时,下面的函数会被调用并打印from,message和messageSid,但它无法将twiml响应发送回电话号码。我在twilio消息日志中看不到任何日志。

require 'twilio-ruby'
require 'sinatra'

module Api
  module V2
    class TextableInboundController < ApplicationController
      # Respond to incoming calls with a simple text message
      def process_incoming
        from = params["From"];
        message = params["Body"];
        messageSid = params["MessageSid"];
        puts from
        puts message
        puts messageSid
        twiml = Twilio::TwiML::Response.new do |r|
          r.Message 'The Robots are coming! Head for the hills!'
        end
        twiml.text
        #Send message to user

      end
    end
  end
end

0 个答案:

没有答案