Sha256: d08ef42816f296bc8a87beefb73c9271c628736422a3d140dfad1763694fd783

Contents?: true

Size: 768 Bytes

Versions: 2

Compression:

Stored size: 768 Bytes

Contents

require 'rubygems'
require 'restcomm-ruby'

# print a list of all phone calls, what phone number each was to/from, and how
# much each one cost.

# put your Restcomm credentials here. you can find your AccountSid and AuthToken
# at the top of your account dashboard page located at:
#   
account_sid = 'AC043dcf9844e04758bc3a36a84c29761'
auth_token = '62ea81de3a5b414154eb263595357c69'
host = 'IP_Address_Restcomm_Instance'

# set up a client
client = Restcomm::REST::Client.new(account_sid, auth_token, host)

calls = client.calls.list

begin
  calls.each do |call|
    price = call.price || '0.00' # since apparently prices can be nil...
    puts call.sid + "\t" + call.from + "\t" + call.to + "\t" + price
  end
  calls = calls.next_page
end while not calls.empty?

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restcomm-ruby-1.2.1 examples/print-call-log.rb
restcomm-ruby-1.2.0 examples/print-call-log.rb