docs/usage/phone-calls.rst in twilio-ruby-3.11.0 vs docs/usage/phone-calls.rst in twilio-ruby-3.11.1
- old
+ new
@@ -23,11 +23,11 @@
# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
- @call = @client.calls.create({:to => "9991231234",
+ @call = @client.account.calls.create({:to => "9991231234",
:from => "9991231234",
:url => "http://foo.com/call.xml"})
puts @call.length
puts @call.sid
@@ -46,11 +46,11 @@
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
sid = "CA12341234"
- @call = @client.calls.get(sid)
+ @call = @client.account.calls.get(sid)
Accessing Specific Call Resources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -67,11 +67,11 @@
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
sid = "CA12341234"
- @call = @client.calls.get(sid)
+ @call = @client.account.calls.get(sid)
puts @call.notifications.list()
puts @call.recordings.list()
puts @call.transcriptions.list()
@@ -98,22 +98,20 @@
--------------------
The :class:`Call` resource makes it easy to find current live calls and
redirect them as necessary
-.. code-block:: python
-
.. code-block:: ruby
require 'twilio-ruby'
# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
- @calls = @client.calls.list({:status => "in-progress")
+ @calls = @client.account.calls.list({:status => "in-progress"})
@calls.each do |call|
call.redirect_to("http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
end
@@ -127,11 +125,11 @@
# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
- @calls = @client.calls.list({:status => "in-progress")
+ @calls = @client.account.calls.list({:status => "in-progress"})
@calls.each do |call|
call.hangup()
end
@@ -148,11 +146,11 @@
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
sid = "CA12341234"
- @client.calls.get(sid).redirect_to("http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
+ @client.account.calls.get(sid).redirect_to("http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
Hanging up the call also works.
.. code-block:: ruby
@@ -162,7 +160,7 @@
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
sid = "CA12341234"
- @client.calls.get(sid).hangup()
+ @client.account.calls.get(sid).hangup()