SDK Upgrade (Legacy to Active)
Upgrade from Ruby Legacy to v4.9.0 or Latest Version
Migrate from legacy Ruby SDK to v4.9.0+ — code changes required
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Migrate from legacy Ruby SDK to v4.9.0+ — code changes required
require 'plivo'
require 'plivo'
p = RestAPI.new("<auth_id>","<auth_token>")
api = RestClient.new("<auth_id>","<auth_token>")
response = p.make_call(params)
response = api.calls.create(params)
require 'rubygems'
require 'plivo'
include Plivo
AUTH_ID = "<auth_id>"
AUTH_TOKEN = "<auth_token>"
p = RestAPI.new(AUTH_ID, AUTH_TOKEN)
params = {
'to' => '12025552323',
'from' => '12025551212',
'answer_url' => 'https://s3.amazonaws.com/static.plivo.com/answer.xml',
'answer_method' => 'GET'
}
response = p.make_call(params)
print response
require 'rubygems'
require 'plivo'
include Plivo
include Plivo::Exceptions
api = RestClient.new("<auth_id>","<auth_token>")
begin
response = api.calls.create(
'+12025551212',
['+12025552323'],
'https://s3.amazonaws.com/static.plivo.com/answer.xml'
)
puts response
rescue PlivoRESTError => e
puts 'Exception: ' + e.message
end
require 'rubygems'
require 'plivo'
include Plivo
response = Response.new()
params = {
'dialMusic' => "https://<yourdomain>.com/dial_music/"
}
dial = response.addDial(params)
first_number = "12025552323"
dial.addNumber(first_number)
puts response.to_xml()
require 'rubygems'
require 'plivo'
include Plivo::XML
include Plivo::Exceptions
begin
response = Response.new
params = {
'dialMusic' => "https://<yourdomain>.com/dial_music/"
}
dial = response.addDial(params)
first_number = "12025552323"
dial.addNumber(first_number)
xml = PlivoXML.new(response)
puts xml.to_xml
rescue PlivoXMLError => e
puts 'Exception: ' + e.message
end
require 'rubygems'
require 'plivo'
include Plivo
response = Response.new()
params = {
'startConferenceOnEnter' => "false",
'waitSound' => "https://<yourdomain>.com/waitmusic/"
}
conference_name = "My Room"
response.addConference(conference_name, params)
puts response.to_xml()
require 'rubygems'
require 'plivo'
include Plivo::XML
include Plivo::Exceptions
begin
response = Response.new
params = {
'startConferenceOnEnter' => "false",
'waitSound' => "https://<yourdomain>.com/waitmusic/"
}
conference_name = "My Room"
response.addConference(conference_name, params)
xml = PlivoXML.new(response)
puts xml.to_xml
rescue PlivoXMLError => e
puts 'Exception: ' + e.message
end
require 'rubygems'
require 'plivo'
AUTH_ID = "<auth_id>"
AUTH_TOKEN = "<auth_token>"
p = RestAPI.new(AUTH_ID, AUTH_TOKEN)
params = {'call_uuid' => call_uuid}
response = p.record(params)
print response
require 'rubygems'
require 'plivo'
include Plivo
include Plivo::Exceptions
api = RestClient.new("<auth_id>","<auth_token>")
begin
response = api.calls.record(
'eba53b9e-8fbd-45c1-9444-696d2172fbc8'
)
puts response
rescue PlivoRESTError => e
puts 'Exception: ' + e.message
end
require 'rubygems'
require 'plivo'
include Plivo
response = Response.new()
params = {
'action' => "https://<yourdomain>.com/get_recording/",
'startOnDialAnswer' => "true",
'redirect' => "false"
}
response.addRecord(params)
dial = response.addDial()
number = "12025552323"
dial.addNumber(number)
puts response.to_xml()
require 'rubygems'
require 'plivo'
include Plivo::XML
include Plivo::Exceptions
begin
response = Response.new
params = {
action: 'https://<yourdomain>.com/get_recording/',
startOnDialAnswer: 'true',
redirect: 'false'
}
response.addRecord(params)
dial = response.addDial()
number = '12025552323'
dial.addNumber(number)
xml = PlivoXML.new(response)
puts xml.to_xml
rescue PlivoXMLError => e
puts 'Exception: ' + e.message
end
Was this page helpful?