Class: Twilio::OutgoingCallerId

Inherits:
TwilioObject show all
Defined in:
lib/twilio/outgoing_caller_id.rb

Overview

An OutgoingCallerId resource represents an outgoing Caller ID that you have registered with Twilio for use when making an outgoing call or using the Dial Verb. Example:

Twilio.connect('my_twilio_sid', 'my_auth_token')
Twilio::OutgoingCallerId.list

Instance Method Summary collapse

Methods inherited from TwilioObject

#connected?, #initialize, method_missing

Constructor Details

This class inherits a constructor from Twilio::TwilioObject

Instance Method Details

#create(phone_number, friendly_name = phone_number, call_delay = 0, extension = nil) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/twilio/outgoing_caller_id.rb', line 8

def create(phone_number, friendly_name = phone_number, call_delay = 0, extension = nil)
  Twilio.post("/OutgoingCallerIds", :body => {
    :PhoneNumber => phone_number, 
    :FriendlyName => friendly_name, 
    :CallDelay => call_delay,
    :Extension => extension
  })
end

#delete(callerid_sid) ⇒ Object



29
30
31
# File 'lib/twilio/outgoing_caller_id.rb', line 29

def delete(callerid_sid)
  Twilio.delete("/OutgoingCallerIds/#{callerid_sid}")
end

#get(callerid_sid) ⇒ Object



21
22
23
# File 'lib/twilio/outgoing_caller_id.rb', line 21

def get(callerid_sid)
  Twilio.get("/OutgoingCallerIds/#{callerid_sid}") 
end

#list(opts = {}) ⇒ Object



17
18
19
# File 'lib/twilio/outgoing_caller_id.rb', line 17

def list(opts = {})
  Twilio.get("/OutgoingCallerIds", :query => (opts.empty? ? nil : opts)) 
end

#update_name(callerid_sid, name) ⇒ Object



25
26
27
# File 'lib/twilio/outgoing_caller_id.rb', line 25

def update_name(callerid_sid, name)
  Twilio.put("/OutgoingCallerIds/#{callerid_sid}", :body => {:FriendlyName => name})
end