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 Attribute Summary

Attributes inherited from TwilioObject

#connection

Instance Method Summary collapse

Methods inherited from TwilioObject

#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) ⇒ Object



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

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

#delete(callerid_sid) ⇒ Object



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

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

#get(callerid_sid) ⇒ Object



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

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

#list(optional = {}) ⇒ Object



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

def list(optional = {})
  Twilio.get("/OutgoingCallerIds", :query => optional) 
end

#update_name(callerid_sid, name) ⇒ Object



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

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