This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CallsController < ApplicationController | |
def index | |
require 'rubygems' | |
require 'twilio-ruby' | |
account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' | |
@client = Twilio::REST::Client.new account_sid, auth_token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Telapi.config do |config| | |
config.account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
config.auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CallsController < ApplicationController | |
def index | |
Telapi::Call.make | |
( | |
'+15555555555', # The client's number to call | |
'+19876543210', # The customized caller ID (i.e. your office's number that your clients will recognize) | |
'http://remind-my-clients.herokuapp.com/remind-my-clients.xml' | |
) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'telapi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Say> | |
Hello there. This is a reminder of your upcoming appointment with our office. | |
</Say> | |
</Response> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Inbound XML document to be stored on your server. | |
Ensure the Voice Request URL for your TelAPI number points to where this XML document is stored. | |
--> | |
<!-- An InboundXML document is made up of various XML elements nested in the response element.--> | |
<Response> | |
<!-- The <Dial> element starts an outgoing call from an existing call --> | |
<!-- This is the actual number of the phone you would like to receive the call --> | |
<Dial>15555555555</Dial> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Response> | |
<!-- The following <Say> element will notify the caller that the call is being recorded --> | |
<Say>The following call is being recorded.</Say> | |
<!-- | |
The 'Record' element is used to record the audio during the call. | |
The 'action' URL is where the Record parameters will be sent. | |
The HTTP 'method' used to do so is a POST. | |
The 'transcribe' attribute boolean value is set to true so the call will be transcribed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CallsController < ApplicationController | |
def ivr | |
xml = Telapi::InboundXml.new do # TelAPI inbound XML document | |
# Gather is used to obtain the digits callers submit in response to their IVR selection optioners options | |
Gather( | |
# URL where the gathered digits will be sent for further processing | |
:action => "http://ivrdemo.com/ivr-user-response.rb", | |
# HTTP method used to request the action URL | |
:method => "GET", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RemindersController < ApplicationController | |
def reminder | |
if dateToRemind == Time.now | |
# Send SMS via TelAPI's REST API | |
Telapi::Message.create(number_to_send_to, | |
number_to_send_from, | |
'This is a reminder of your upcoming appointment tomorrow.' ) | |
else | |
puts "It's not time to remind them yet." | |
end |
OlderNewer