twilio_resource 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,7 @@ module TwilioResource
12
12
  autoload :IncomingPhoneNumber, 'twilio_resource/incoming_phone_number'
13
13
  autoload :LocalIncomingPhoneNumber, 'twilio_resource/local_incoming_phone_number'
14
14
  autoload :TollFreeIncomingPhoneNumber, 'twilio_resource/toll_free_incoming_phone_number'
15
+ autoload :OutgoingCallerId, 'twilio_resource/outgoing_caller_id'
15
16
 
16
17
  class << self
17
18
  attr_accessor :logger
@@ -3,4 +3,9 @@
3
3
  # can be found at
4
4
  # http://www.twilio.com/docs/api/2008-08-01/rest/account
5
5
  class TwilioResource::Account < TwilioResource::Base
6
+
7
+ ACTIVE = "active"
8
+ SUSPENDED = "suspended"
9
+ CLOSED = "closed"
10
+
6
11
  end
@@ -73,6 +73,6 @@ class TwilioResource::Base < ReactiveResource::Base
73
73
 
74
74
 
75
75
  self.site = "https://api.twilio.com"
76
- self.prefix = '/2008-08-01/'
76
+ self.prefix = '/2010-04-01/'
77
77
  self.format = :twilio
78
78
  end
@@ -5,16 +5,27 @@
5
5
  class TwilioResource::Call < TwilioResource::Base
6
6
  belongs_to :account
7
7
 
8
- NOT_DIALED = 0
9
- IN_PROGRESS = 1
10
- COMPLETE = 2
8
+ NOT_DIALED = "queued"
9
+ IN_PROGRESS = "in-progress"
10
+ COMPLETE = "completed"
11
+ RINGING = "ringing"
12
+ FAILED = "failed"
13
+ BUSY = "busy"
14
+ NO_ANSWER = "no-answer"
11
15
 
12
- # Returns the status of the call. Can be
13
- # TwilioResource::Call::NOT_DIALED,
14
- # TwilioResource::Call::IN_PROGRESS, or
15
- # TwilioResource::Call::COMPLETE
16
- def status
17
- attributes["status"].to_i if attributes["status"]
16
+ # old end-point
17
+ def called
18
+ self.to
18
19
  end
19
-
20
+
21
+ # old end-point
22
+ def caller
23
+ self.from
24
+ end
25
+
26
+ # old end-point
27
+ def call_segment_sid
28
+ self.parent_call_sid
29
+ end
30
+
20
31
  end
@@ -0,0 +1,3 @@
1
+ class TwilioResource::OutgoingCallerId < TwilioResource::Base
2
+ belongs_to :account
3
+ end
@@ -11,7 +11,7 @@ class TwilioResource::AccountTest < Test::Unit::TestCase
11
11
  def test_find_account
12
12
  TwilioResource::Base.user = 1
13
13
  account = TwilioResource::Account.find(1)
14
- assert_equal "2", account.status
14
+ assert_equal TwilioResource::Account::ACTIVE, account.status
15
15
  end
16
16
 
17
17
  end
@@ -14,8 +14,10 @@ class TwilioResource::CallTest < Test::Unit::TestCase
14
14
 
15
15
  # check attributes were assigned correctly
16
16
  call = calls.first
17
- assert_equal('4159633717', call.called)
18
- assert_equal('4156767925', call.caller)
17
+ assert_equal('+15304551166', call.called)
18
+ assert_equal('+15304551166', call.to)
19
+ assert_equal('+15105555555', call.caller)
20
+ assert_equal('+15105555555', call.from)
19
21
  assert(call.call_segment_sid.blank?)
20
22
  end
21
23
 
@@ -5,8 +5,14 @@ class TwilioResource::LocalIncomingPhoneNumberTest < Test::Unit::TestCase
5
5
 
6
6
  def setup
7
7
  super
8
+ @old_user = TwilioResource::Base.user
8
9
  TwilioMock.setup_remote_fixtures
9
10
  end
11
+
12
+ def teardown
13
+ TwilioResource::Base.user = @old_user
14
+ super
15
+ end
10
16
 
11
17
  def test_provision_local_number
12
18
  phone = TwilioResource::LocalIncomingPhoneNumber.new(:url => "http://example.com/calls",
@@ -14,7 +20,7 @@ class TwilioResource::LocalIncomingPhoneNumberTest < Test::Unit::TestCase
14
20
  :method => 'POST',
15
21
  :friendly_name => "My Local Number",
16
22
  :account_id => 1)
17
- assert_equal "AreaCode=206&FriendlyName=My+Local+Number&Method=POST&Url=http%3A%2F%2Fexample.com%2Fcalls", phone.encode
23
+ assert_equal "AccountId=1&AreaCode=206&FriendlyName=My+Local+Number&Method=POST&Url=http%3A%2F%2Fexample.com%2Fcalls", phone.encode
18
24
  phone.save
19
25
 
20
26
  assert_equal '2064567890', phone.phone_number
@@ -27,11 +33,10 @@ class TwilioResource::LocalIncomingPhoneNumberTest < Test::Unit::TestCase
27
33
  :method => 'POST',
28
34
  :friendly_name => "My Local Number",
29
35
  :account_id => TwilioResource::Base.user)
30
- assert_equal "AreaCode=815&FriendlyName=My+Local+Number&Method=POST&Url=http%3A%2F%2Fexample.com%2Fcalls", phone.encode
36
+ assert_equal "AccountId=2&AreaCode=815&FriendlyName=My+Local+Number&Method=POST&Url=http%3A%2F%2Fexample.com%2Fcalls", phone.encode
31
37
  assert_raises TwilioResource::NoPhoneNumbersFoundException do
32
38
  phone.save
33
39
  end
34
-
35
40
  end
36
41
 
37
42
  # test find, update
@@ -0,0 +1,29 @@
1
+ require 'test_helper'
2
+ require 'twilio_mock'
3
+
4
+ class TwilioResource::OutgoingCallerIdTest < Test::Unit::TestCase
5
+
6
+ def setup
7
+ super
8
+ TwilioMock.setup_remote_fixtures
9
+ end
10
+
11
+ def test_find_all
12
+ caller_ids = TwilioResource::OutgoingCallerId.find(:all, :params => {:account_id => 1})
13
+ assert_equal 1, caller_ids.length
14
+
15
+ # check attributes were assigned correctly
16
+ caller_id = caller_ids.first
17
+ assert_equal('+15105555555', caller_id.phone_number)
18
+ end
19
+
20
+ def test_find_by_phone_number
21
+ caller_ids = TwilioResource::OutgoingCallerId.find(:all, :params => {:account_id => 1, :friendly_name => "Foo"})
22
+ assert_equal 1, caller_ids.length
23
+
24
+ # check attributes were assigned correctly
25
+ caller_id = caller_ids.first
26
+ assert_equal('+15105555555', caller_id.phone_number)
27
+ end
28
+
29
+ end
@@ -14,7 +14,7 @@ class TwilioResource::TollFreeIncomingPhoneNumberTest < Test::Unit::TestCase
14
14
  :method => 'POST',
15
15
  :friendly_name => "My Local Number",
16
16
  :account_id => TwilioResource::Base.user)
17
- assert_equal "FriendlyName=My+Local+Number&Method=POST&Url=http%3A%2F%2Fexample.com%2Fcalls", phone.encode
17
+ assert_equal "AccountId=1&FriendlyName=My+Local+Number&Method=POST&Url=http%3A%2F%2Fexample.com%2Fcalls", phone.encode
18
18
  phone.save
19
19
 
20
20
  assert_equal '8774567890', phone.phone_number
@@ -1,35 +1,37 @@
1
1
  require 'active_resource/http_mock'
2
2
 
3
3
  class TwilioMock
4
-
4
+
5
5
  def self.setup_remote_fixtures
6
6
  ActiveResource::HttpMock.respond_to do |mock|
7
- mock.get '/2008-08-01/Accounts/1', auth_get(1), main_account
8
- mock.post '/2008-08-01/Accounts/1/IncomingPhoneNumbers/Local', auth_post(1), local_number_provision_success
9
- mock.post '/2008-08-01/Accounts/2/IncomingPhoneNumbers/Local', auth_post(2), no_local_number, 400
10
- mock.post '/2008-08-01/Accounts/1/IncomingPhoneNumbers/TollFree', auth_post(1), toll_free_number_provision_success
7
+ mock.get '/2010-04-01/Accounts/1', auth_get(1), main_account
8
+ mock.post '/2010-04-01/Accounts/1/IncomingPhoneNumbers/Local', auth_post(1), local_number_provision_success
9
+ mock.post '/2010-04-01/Accounts/2/IncomingPhoneNumbers/Local', auth_post(2), no_local_number, 400
10
+ mock.post '/2010-04-01/Accounts/1/IncomingPhoneNumbers/TollFree', auth_post(1), toll_free_number_provision_success
11
11
 
12
- mock.get '/2008-08-01/Accounts/1/Calls', auth_get(1), all_calls
13
- mock.get '/2008-08-01/Accounts/1/Calls?StartTime=2009-09-01', auth_get(1), recent_calls
14
- mock.get '/2008-08-01/Accounts/1/Calls?Status=2', auth_get(1), succeeded_recent_calls
15
- mock.get '/2008-08-01/Accounts/1/Calls?StartTime=2009-09-01&Status=2', auth_get(1), no_calls
12
+ mock.get '/2010-04-01/Accounts/1/Calls', auth_get(1), all_calls
13
+ mock.get '/2010-04-01/Accounts/1/Calls?StartTime=2009-09-01', auth_get(1), recent_calls
14
+ mock.get '/2010-04-01/Accounts/1/Calls?Status=completed', auth_get(1), succeeded_recent_calls
15
+ mock.get '/2010-04-01/Accounts/1/Calls?StartTime=2009-09-01&Status=completed', auth_get(1), no_calls
16
16
 
17
- mock.get '/2008-08-01/Accounts/1/IncomingPhoneNumbers/1', auth_get(1), phone_number_data
18
- mock.delete '/2008-08-01/Accounts/1/IncomingPhoneNumbers/1', auth_delete(1), phone_number_delete_success
19
- mock.delete '/2008-08-01/Accounts/2/IncomingPhoneNumbers/2', auth_delete(2), "", 404
17
+ mock.get '/2010-04-01/Accounts/1/IncomingPhoneNumbers/1', auth_get(1), phone_number_data
18
+ mock.delete '/2010-04-01/Accounts/1/IncomingPhoneNumbers/1', auth_delete(1), phone_number_delete_success
19
+ mock.delete '/2010-04-01/Accounts/2/IncomingPhoneNumbers/2', auth_delete(2), "", 404
20
20
 
21
+ mock.get '/2010-04-01/Accounts/1/OutgoingCallerIds', auth_get(1), all_caller_ids
22
+ mock.get '/2010-04-01/Accounts/1/OutgoingCallerIds?FriendlyName=Foo', auth_get(1), friendly_name_caller_ids
21
23
  end
22
24
 
23
25
  end
24
26
 
25
27
  def self.build_header(method)
26
- if ActiveResource::VERSION::MAJOR == 3
28
+ if defined?(ActiveResource::VERSION) && ActiveResource::VERSION::MAJOR == 3
27
29
  TwilioResource::Account.connection.send(:build_request_headers, {}, method, '')
28
30
  else
29
31
  TwilioResource::Account.connection.send(:build_request_headers, {})
30
32
  end
31
33
  end
32
-
34
+
33
35
  def self.auth_delete(account_id)
34
36
  old_account_id = TwilioResource::Base.user
35
37
  TwilioResource::Base.user = account_id
@@ -56,17 +58,34 @@ class TwilioMock
56
58
 
57
59
  def self.phone_number_data
58
60
  <<END
59
- <TwilioResponse>
60
- <IncomingPhoneNumber>
61
- <Sid>PNe536dfda7c6184afab78d980cb8cdf43</Sid>
62
- <AccountSid>AC35542fc30a091bed0c1ed511e1d9935d</AccountSid>
63
- <FriendlyName>My Home Phone Number</FriendlyName>
64
- <PhoneNumber>4158675309</PhoneNumber>
65
- <Url>http://mycompany.com/handleMainLineCall.asp</Url>
66
- <Method>GET</Method>
67
- <DateCreated>Tue, 01 Apr 2008 11:26:32 -0700</DateCreated>
68
- <DateUpdated>Tue, 01 Apr 2008 11:26:32 -0700</DateUpdated>
69
- </IncomingPhoneNumber>
61
+ <TwilioResponse>
62
+ <IncomingPhoneNumber>
63
+ <Sid>PNe536dfda7c6184afab78d980cb8cdf43</Sid>
64
+ <AccountSid>AC35542fc30a091bed0c1ed511e1d9935d</AccountSid>
65
+ <FriendlyName>My Home Phone Number</FriendlyName>
66
+ <PhoneNumber>4158675309</PhoneNumber>
67
+ <VoiceUrl>http://mycompany.com/handleNewCall.php</VoiceUrl>
68
+ <VoiceMethod>POST</VoiceMethod>
69
+ <VoiceFallbackUrl/>
70
+ <VoiceFallbackMethod>POST</VoiceFallbackMethod>
71
+ <StatusCallback/>
72
+ <StatusCallbackMethod/>
73
+ <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
74
+ <VoiceApplicationSid/>
75
+ <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
76
+ <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
77
+ <SmsUrl/>
78
+ <SmsMethod>POST</SmsMethod>
79
+ <SmsFallbackUrl/>
80
+ <SmsFallbackMethod>GET</SmsFallbackMethod>
81
+ <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
82
+ <Capabilities>
83
+ <Voice>true</Voice>
84
+ <SMS>true</SMS>
85
+ </Capabilities>
86
+ <ApiVersion>2010-04-01</ApiVersion>
87
+ <Uri>/2010-04-01/Accounts/ACdc5f1e11047ebd6fe7a55f120be3a900/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
88
+ </IncomingPhoneNumber>
70
89
  </TwilioResponse>
71
90
  END
72
91
  end
@@ -74,16 +93,29 @@ END
74
93
  def self.main_account
75
94
  <<END
76
95
  <TwilioResponse>
77
- <Account>
78
- <Sid>AC309475e5fede1b49e100272a8640f438</Sid>
79
- <FriendlyName>My Twilio Account</FriendlyName>
80
- <Status>2</Status>
81
- <StatusText>Active</StatusText>
82
- <DateCreated>Wed, 02 Apr 2008 17:33:38 -0700</DateCreated>
83
- <DateUpdated>Wed, 02 Apr 2008 17:34:18 -0700</DateUpdated>
84
- <AuthToken>3a2630a909aadbf60266234756fb15a0</AuthToken>
85
- </Account>
86
- </TwilioResponse>
96
+ <Account>
97
+ <Sid>AC309475e5fede1b49e100272a8640f438</Sid>
98
+ <FriendlyName>My Twilio Account</FriendlyName>
99
+ <Type>Full</Type>
100
+ <Status>active</Status>
101
+ <DateCreated>Wed, 04 Aug 2010 21:37:41 +0000</DateCreated>
102
+ <DateUpdated>Fri, 06 Aug 2010 01:15:02 +0000</DateUpdated>
103
+ <AuthToken>redacted</AuthToken>
104
+ <Uri>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d</Uri>
105
+ <SubresourceUris>
106
+ <AvailablePhoneNumbers>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/AvailablePhoneNumbers</AvailablePhoneNumbers>
107
+ <Calls>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Calls</Calls>
108
+ <Conferences>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Conferences</Conferences>
109
+ <IncomingPhoneNumbers>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/IncomingPhoneNumbers</IncomingPhoneNumbers>
110
+ <Notifications>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Notifications</Notifications>
111
+ <OutgoingCallerIds>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/OutgoingCallerIds</OutgoingCallerIds>
112
+ <Recordings>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Recordings</Recordings>
113
+ <Sandbox>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Sandbox</Sandbox>
114
+ <SMSMessages>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/SMS/Messages</SMSMessages>
115
+ <Transcriptions>/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/Transcriptions</Transcriptions>
116
+ </SubresourceUris>
117
+ </Account>
118
+ </TwilioResponse>
87
119
  END
88
120
  end
89
121
 
@@ -95,247 +127,407 @@ END
95
127
 
96
128
  def self.all_calls
97
129
  <<END
98
- <TwilioResponse>
99
- <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
100
- <Call>
101
- <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
102
- <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
103
- <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
104
- <CallSegmentSid/>
105
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
106
- <Called>4159633717</Called>
107
- <Caller>4156767925</Caller>
108
- <PhoneNumberSid>PN01234567890123456789012345678900</PhoneNumberSid>
109
- <Status>2</Status>
110
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
111
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
112
- <Duration>14</Duration>
113
- <Price/>
114
- <Flags>1</Flags>
115
- </Call>
116
- <Call>
117
- <Sid>CA751e8fa0a0105cf26a0d7a9775fb4bfb</Sid>
118
- <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
119
- <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
120
- <CallSegmentSid/>
121
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
122
- <Called>2064287985</Called>
123
- <Caller>4156767925</Caller>
124
- <PhoneNumberSid>PNd59c2ba27ef48264773edb90476d1674</PhoneNumberSid>
125
- <Status>2</Status>
126
- <StartTime>Thu, 03 Apr 2008 01:37:05 -0400</StartTime>
127
- <EndTime>Thu, 03 Apr 2008 01:37:40 -0400</EndTime>
128
- <Duration>35</Duration>
129
- <Price/>
130
- <Flags>1</Flags>
131
- </Call>
132
- </Calls>
133
- </TwilioResponse>
130
+ <TwilioResponse>
131
+ <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
132
+ <Call>
133
+ <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
134
+ <DateCreated>Fri, 13 Aug 2010 01:16:22 +0000</DateCreated>
135
+ <DateUpdated>Fri, 13 Aug 2010 01:16:22 +0000</DateUpdated>
136
+ <ParentCallSid/>
137
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
138
+ <To>+15304551166</To>
139
+ <From>+15105555555</From>
140
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
141
+ <Status>queued</Status>
142
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
143
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
144
+ <Duration/>
145
+ <Price/>
146
+ <Direction>outbound-api</Direction>
147
+ <AnsweredBy/>
148
+ <ApiVersion>2010-04-01</ApiVersion>
149
+ <ForwardedFrom/>
150
+ <CallerName/>
151
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
152
+ <SubresourceUris>
153
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
154
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
155
+ </SubresourceUris>
156
+ </Call>
157
+ <Call>
158
+ <Sid>CA751e8fa0a0105cf26a0d7a9775fb4bfb</Sid>
159
+ <DateCreated>Fri, 13 Aug 2010 01:16:22 +0000</DateCreated>
160
+ <DateUpdated>Fri, 13 Aug 2010 01:16:22 +0000</DateUpdated>
161
+ <ParentCallSid/>
162
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
163
+ <To>+15304551166</To>
164
+ <From>+15105555555</From>
165
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
166
+ <Status>queued</Status>
167
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
168
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
169
+ <Duration/>
170
+ <Price/>
171
+ <Direction>outbound-api</Direction>
172
+ <AnsweredBy/>
173
+ <ApiVersion>2010-04-01</ApiVersion>
174
+ <ForwardedFrom/>
175
+ <CallerName/>
176
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
177
+ <SubresourceUris>
178
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
179
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
180
+ </SubresourceUris>
181
+ </Call>
182
+ </Calls>
183
+ </TwilioResponse>
134
184
  END
135
185
  end
136
186
 
137
187
  def self.succeeded_calls
138
188
  <<END
139
- <TwilioResponse>
140
- <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
141
- <Call>
142
- <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
189
+ <TwilioResponse>
190
+ <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
191
+ <Call>
192
+ <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
143
193
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
144
194
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
145
- <CallSegmentSid/>
146
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
147
- <Called>4159633717</Called>
148
- <Caller>4156767925</Caller>
149
- <PhoneNumberSid>PN01234567890123456789012345678900</PhoneNumberSid>
150
- <Status>2</Status>
151
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
152
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
153
- <Duration>14</Duration>
154
- <Price/>
155
- <Flags>1</Flags>
156
- </Call>
157
- <Call>
158
- <Sid>1000</Sid>
195
+ <ParentCallSid/>
196
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
197
+ <To>+15304551166</To>
198
+ <From>+15105555555</From>
199
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
200
+ <Status>completed</Status>
201
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
202
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
203
+ <Duration>14</Duration>
204
+ <Price/>
205
+ <Direction>outbound-api</Direction>
206
+ <AnsweredBy/>
207
+ <ApiVersion>2010-04-01</ApiVersion>
208
+ <ForwardedFrom/>
209
+ <CallerName/>
210
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
211
+ <SubresourceUris>
212
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
213
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
214
+ </SubresourceUris>
215
+ </Call>
216
+ <Call>
217
+ <Sid>1000</Sid>
159
218
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
160
219
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
161
- <CallSegmentSid>10001</CallSegmentSid>
162
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
163
- <Called>4159633717</Called>
164
- <Caller>4156767925</Caller>
165
- <PhoneNumberSid>ABC123</PhoneNumberSid>
166
- <Status>2</Status>
167
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
168
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
169
- <Duration>14</Duration>
170
- <Price/>
171
- <Flags>1</Flags>
220
+ <ParentCallSid/>
221
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
222
+ <To>+15304551166</To>
223
+ <From>+15105555555</From>
224
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
225
+ <Status>completed</Status>
226
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
227
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
228
+ <Duration>14</Duration>
229
+ <Price/>
230
+ <Direction>outbound-api</Direction>
231
+ <AnsweredBy/>
232
+ <ApiVersion>2010-04-01</ApiVersion>
233
+ <ForwardedFrom/>
234
+ <CallerName/>
235
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
236
+ <SubresourceUris>
237
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
238
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
239
+ </SubresourceUris>
172
240
  </Call>
173
- <Call>
174
- <Sid>1001</Sid>
241
+ <Call>
242
+ <Sid>1001</Sid>
175
243
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
176
244
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
177
- <CallSegmentSid>10002</CallSegmentSid>
178
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
179
- <Called>4159633717</Called>
180
- <Caller>4156767925</Caller>
181
- <PhoneNumberSid>ABC123</PhoneNumberSid>
182
- <Status>2</Status>
183
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
184
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
185
- <Duration>14</Duration>
186
- <Price/>
187
- <Flags>1</Flags>
245
+ <ParentCallSid/>
246
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
247
+ <To>+15304551166</To>
248
+ <From>+15105555555</From>
249
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
250
+ <Status>completed</Status>
251
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
252
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
253
+ <Duration>14</Duration>
254
+ <Price/>
255
+ <Direction>outbound-api</Direction>
256
+ <AnsweredBy/>
257
+ <ApiVersion>2010-04-01</ApiVersion>
258
+ <ForwardedFrom/>
259
+ <CallerName/>
260
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
261
+ <SubresourceUris>
262
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
263
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
264
+ </SubresourceUris>
188
265
  </Call>
189
- <Call>
190
- <Sid>1002</Sid>
266
+ <Call>
267
+ <Sid>1002</Sid>
191
268
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
192
269
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
193
- <CallSegmentSid>10003</CallSegmentSid>
194
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
195
- <Called>4159633717</Called>
196
- <Caller>4156767925</Caller>
197
- <PhoneNumberSid>ABC123</PhoneNumberSid>
198
- <Status>2</Status>
199
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
200
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
201
- <Duration>14</Duration>
202
- <Price/>
203
- <Flags>1</Flags>
270
+ <ParentCallSid/>
271
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
272
+ <To>+15304551166</To>
273
+ <From>+15105555555</From>
274
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
275
+ <Status>completed</Status>
276
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
277
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
278
+ <Duration>14</Duration>
279
+ <Price/>
280
+ <Direction>outbound-api</Direction>
281
+ <AnsweredBy/>
282
+ <ApiVersion>2010-04-01</ApiVersion>
283
+ <ForwardedFrom/>
284
+ <CallerName/>
285
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
286
+ <SubresourceUris>
287
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
288
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
289
+ </SubresourceUris>
204
290
  </Call>
205
- <Call>
206
- <Sid>1003</Sid>
291
+ <Call>
292
+ <Sid>1003</Sid>
207
293
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
208
294
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
209
- <CallSegmentSid>10004</CallSegmentSid>
210
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
211
- <Called>4159633717</Called>
212
- <Caller>4156767925</Caller>
213
- <PhoneNumberSid>UNKNOWN</PhoneNumberSid>
214
- <Status>2</Status>
215
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
216
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
217
- <Duration>14</Duration>
218
- <Price/>
219
- <Flags>1</Flags>
295
+ <ParentCallSid/>
296
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
297
+ <To>+15304551166</To>
298
+ <From>+15105555555</From>
299
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
300
+ <Status>completed</Status>
301
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
302
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
303
+ <Duration>14</Duration>
304
+ <Price/>
305
+ <Direction>outbound-api</Direction>
306
+ <AnsweredBy/>
307
+ <ApiVersion>2010-04-01</ApiVersion>
308
+ <ForwardedFrom/>
309
+ <CallerName/>
310
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
311
+ <SubresourceUris>
312
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
313
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
314
+ </SubresourceUris>
220
315
  </Call>
221
- <Call>
222
- <Sid>AVENDORIDAVENDORIDAVENDORID</Sid>
316
+ <Call>
317
+ <Sid>AVENDORIDAVENDORIDAVENDORID</Sid>
223
318
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
224
319
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
225
- <CallSegmentSid>10004</CallSegmentSid>
226
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
227
- <Called>4159633717</Called>
228
- <Caller>4156767925</Caller>
229
- <PhoneNumberSid>ABC123</PhoneNumberSid>
230
- <Status>2</Status>
231
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
232
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
233
- <Duration>14</Duration>
234
- <Price/>
235
- <Flags>1</Flags>
320
+ <ParentCallSid/>
321
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
322
+ <To>+15304551166</To>
323
+ <From>+15105555555</From>
324
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
325
+ <Status>completed</Status>
326
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
327
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
328
+ <Duration>14</Duration>
329
+ <Price/>
330
+ <Direction>outbound-api</Direction>
331
+ <AnsweredBy/>
332
+ <ApiVersion>2010-04-01</ApiVersion>
333
+ <ForwardedFrom/>
334
+ <CallerName/>
335
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
336
+ <SubresourceUris>
337
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
338
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
339
+ </SubresourceUris>
236
340
  </Call>
237
- </Calls>
238
- </TwilioResponse>
341
+ </Calls>
342
+ </TwilioResponse>
239
343
  END
240
344
  end
241
345
 
242
346
  def self.recent_calls
243
347
  <<END
244
- <TwilioResponse>
245
- <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
246
- <Call>
247
- <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
348
+ <TwilioResponse>
349
+ <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
350
+ <Call>
351
+ <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
248
352
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
249
353
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
250
- <CallSegmentSid/>
251
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
252
- <Called>4159633717</Called>
253
- <Caller>4156767925</Caller>
254
- <PhoneNumberSid>PN01234567890123456789012345678900</PhoneNumberSid>
255
- <Status>1</Status>
256
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
257
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
258
- <Duration>14</Duration>
259
- <Price/>
260
- <Flags>1</Flags>
354
+ <ParentCallSid/>
355
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
356
+ <To>+15304551166</To>
357
+ <From>+15105555555</From>
358
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
359
+ <Status>completed</Status>
360
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
361
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
362
+ <Duration>14</Duration>
363
+ <Price/>
364
+ <Direction>outbound-api</Direction>
365
+ <AnsweredBy/>
366
+ <ApiVersion>2010-04-01</ApiVersion>
367
+ <ForwardedFrom/>
368
+ <CallerName/>
369
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
370
+ <SubresourceUris>
371
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
372
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
373
+ </SubresourceUris>
261
374
  </Call>
262
- </Calls>
263
- </TwilioResponse>
375
+ </Calls>
376
+ </TwilioResponse>
264
377
  END
265
378
  end
266
379
 
267
380
 
268
381
  def self.succeeded_recent_calls
269
382
  <<END
270
- <TwilioResponse>
271
- <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
272
- <Call>
273
- <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
383
+ <TwilioResponse>
384
+ <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
385
+ <Call>
386
+ <Sid>CA42ed11f93dc08b952027ffbc406d0868</Sid>
274
387
  <DateCreated>Sat, 07 Feb 2009 13:15:19 -0800</DateCreated>
275
388
  <DateUpdated>Sat, 07 Feb 2009 13:15:19 -0800</DateUpdated>
276
- <CallSegmentSid>8142ed11f93dc08b952027ffbc406d0868</CallSegmentSid>
277
- <AccountSid>AC309475e5fede1b49e100272a8640f438</AccountSid>
278
- <Called>4159633717</Called>
279
- <Caller>4156767925</Caller>
280
- <PhoneNumberSid>PN01234567890123456789012345678900</PhoneNumberSid>
281
- <Status>2</Status>
282
- <StartTime>Thu, 03 Apr 2008 04:36:33 -0400</StartTime>
283
- <EndTime>Thu, 03 Apr 2008 04:36:47 -0400</EndTime>
284
- <Duration>14</Duration>
285
- <Price/>
286
- <Flags>1</Flags>
389
+ <ParentCallSid/>
390
+ <AccountSid>AC5ef877a5fe4238be081ea6f3c44186f3</AccountSid>
391
+ <To>+15304551166</To>
392
+ <From>+15105555555</From>
393
+ <PhoneNumberSid>PNe2d8e63b37f46f2adb16f228afdb9058</PhoneNumberSid>
394
+ <Status>completed</Status>
395
+ <StartTime>Thu, 12 Aug 2010 01:37:05 +0000</StartTime>
396
+ <EndTime>Thu, 12 Aug 2010 01:37:40 +0000</EndTime>
397
+ <Duration>14</Duration>
398
+ <Price/>
399
+ <Direction>outbound-api</Direction>
400
+ <AnsweredBy/>
401
+ <ApiVersion>2010-04-01</ApiVersion>
402
+ <ForwardedFrom/>
403
+ <CallerName/>
404
+ <Uri>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c</Uri>
405
+ <SubresourceUris>
406
+ <Notifications>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Notifications</Notifications>
407
+ <Recordings>/2010-04-01/Accounts/AC5ef877a5fe4238be081ea6f3c44186f3/Calls/CA92d4405c9237c4ea04b56cbda88e128c/Recordings</Recordings>
408
+ </SubresourceUris>
287
409
  </Call>
288
- </Calls>
289
- </TwilioResponse>
410
+ </Calls>
411
+ </TwilioResponse>
290
412
  END
291
413
  end
292
414
 
293
415
  def self.no_calls
294
416
  <<END
295
- <TwilioResponse>
296
- <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
297
- </Calls>
298
- </TwilioResponse>
417
+ <TwilioResponse>
418
+ <Calls page="0" numpages="1" pagesize="50" total="38" start="0" end="37">
419
+ </Calls>
420
+ </TwilioResponse>
299
421
  END
300
422
  end
301
423
 
302
424
  def self.local_number_provision_success
303
425
  <<END
304
- <TwilioResponse>
305
- <IncomingPhoneNumber>
306
- <Sid>PNe536dfda7c6184afab78d980cb8cdf43</Sid>
307
- <AccountSid>AC35542fc30a091bed0c1ed511e1d9935d</AccountSid>
308
- <FriendlyName>My Local Number</FriendlyName>
309
- <PhoneNumber>2064567890</PhoneNumber>
310
- <Url>http://example.com/calls</Url>
311
- <Method>GET</Method>
312
- <DateCreated>Tue, 01 Apr 2008 11:26:32 -0700</DateCreated>
313
- <DateUpdated>Tue, 01 Apr 2008 11:26:32 -0700</DateUpdated>
314
- </IncomingPhoneNumber>
315
- </TwilioResponse>
426
+ <TwilioResponse>
427
+ <IncomingPhoneNumber>
428
+ <Sid>PNe536dfda7c6184afab78d980cb8cdf43</Sid>
429
+ <AccountSid>AC755325d45d80675a4727a7a54e1b4ce4</AccountSid>
430
+ <FriendlyName>My Local Number</FriendlyName>
431
+ <PhoneNumber>2064567890</PhoneNumber>
432
+ <VoiceUrl>http://myapp.com/awesome</VoiceUrl>
433
+ <VoiceMethod>POST</VoiceMethod>
434
+ <VoiceFallbackUrl/>
435
+ <VoiceFallbackMethod>POST</VoiceFallbackMethod>
436
+ <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
437
+ <VoiceApplicationSid/>
438
+ <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
439
+ <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
440
+ <SmsUrl>http://myapp.com/awesome</SmsUrl>
441
+ <SmsMethod>POST</SmsMethod>
442
+ <SmsFallbackUrl/>
443
+ <SmsFallbackMethod>GET</SmsFallbackMethod>
444
+ <SmsApplicationSid/>
445
+ <Capabilities>
446
+ <Voice>true</Voice>
447
+ <SMS>true</SMS>
448
+ </Capabilities>
449
+ <StatusCallback/>
450
+ <StatusCallbackMethod/>
451
+ <ApiVersion>2010-04-01</ApiVersion>
452
+ <Uri>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
453
+ </IncomingPhoneNumber>
454
+ </TwilioResponse>
316
455
  END
317
456
  end
318
457
 
319
458
  def self.toll_free_number_provision_success
320
459
  <<END
321
- <TwilioResponse>
322
- <IncomingPhoneNumber>
323
- <Sid>PNe536dfda7c6184afab78d980cb8cdf43</Sid>
324
- <AccountSid>AC35542fc30a091bed0c1ed511e1d9935d</AccountSid>
325
- <FriendlyName>My Toll Free Number</FriendlyName>
326
- <PhoneNumber>8774567890</PhoneNumber>
327
- <Url>http://example.com/calls</Url>
328
- <Method>GET</Method>
329
- <DateCreated>Tue, 01 Apr 2008 11:26:32 -0700</DateCreated>
330
- <DateUpdated>Tue, 01 Apr 2008 11:26:32 -0700</DateUpdated>
331
- </IncomingPhoneNumber>
332
- </TwilioResponse>
460
+ <TwilioResponse>
461
+ <IncomingPhoneNumber>
462
+ <Sid>PNe536dfda7c6184afab78d980cb8cdf43</Sid>
463
+ <AccountSid>AC35542fc30a091bed0c1ed511e1d9935d</AccountSid>
464
+ <FriendlyName>My Toll Free Number</FriendlyName>
465
+ <PhoneNumber>8774567890</PhoneNumber>
466
+ <VoiceUrl>http://myapp.com/awesome</VoiceUrl>
467
+ <VoiceMethod>POST</VoiceMethod>
468
+ <VoiceFallbackUrl/>
469
+ <VoiceFallbackMethod>POST</VoiceFallbackMethod>
470
+ <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
471
+ <VoiceApplicationSid/>
472
+ <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
473
+ <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
474
+ <SmsUrl>http://myapp.com/awesome</SmsUrl>
475
+ <SmsMethod>POST</SmsMethod>
476
+ <SmsFallbackUrl/>
477
+ <SmsFallbackMethod>GET</SmsFallbackMethod>
478
+ <SmsApplicationSid/>
479
+ <Capabilities>
480
+ <Voice>true</Voice>
481
+ <SMS>true</SMS>
482
+ </Capabilities>
483
+ <StatusCallback/>
484
+ <StatusCallbackMethod/>
485
+ <ApiVersion>2010-04-01</ApiVersion>
486
+ <Uri>/2010-04-01/Accounts/AC755325d45d80675a4727a7a54e1b4ce4/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
487
+ </IncomingPhoneNumber>
488
+ </TwilioResponse>
333
489
  END
334
490
  end
335
491
 
336
492
  def self.no_local_number
337
493
  <<END
338
494
  <TwilioResponse><RestException><Status>400</Status><Message>No phone numbers found</Message><Code>21452</Code><MoreInfo>http://www.twilio.com/docs/errors/21452</MoreInfo></RestException></TwilioResponse>
495
+ END
496
+ end
497
+
498
+ def self.all_caller_ids
499
+ <<END
500
+ <TwilioResponse>
501
+ <OutgoingCallerIds page="0" numpages="1" pagesize="50" total="1" start="0" end="0" uri="/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds" firstpageuri="/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds?Page=0&amp;PageSize=50" previouspageuri="" nextpageuri="" lastpageuri="/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds?Page=0&amp;PageSize=50">
502
+ <OutgoingCallerId>
503
+ <Sid>PNe905d7e6b410746a0fb08c57e5a186f3</Sid>
504
+ <AccountSid>AC228ba7a5fe4238be081ea6f3c44186f3</AccountSid>
505
+ <FriendlyName>Foo</FriendlyName>
506
+ <PhoneNumber>+15105555555</PhoneNumber>
507
+ <DateCreated>Tue, 27 Jul 2010 20:21:11 +0000</DateCreated>
508
+ <DateUpdated>Tue, 27 Jul 2010 20:21:11 +0000</DateUpdated>
509
+ <Uri>/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3</Uri>
510
+ </OutgoingCallerId>
511
+ </OutgoingCallerIds>
512
+ </TwilioResponse>
513
+ END
514
+ end
515
+
516
+ def self.friendly_name_caller_ids
517
+ <<END
518
+ <TwilioResponse>
519
+ <OutgoingCallerIds page="0" numpages="1" pagesize="50" total="1" start="0" end="0" uri="/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds" firstpageuri="/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds?Page=0&amp;PageSize=50" previouspageuri="" nextpageuri="" lastpageuri="/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds?Page=0&amp;PageSize=50">
520
+ <OutgoingCallerId>
521
+ <Sid>PNe905d7e6b410746a0fb08c57e5a186f3</Sid>
522
+ <AccountSid>AC228ba7a5fe4238be081ea6f3c44186f3</AccountSid>
523
+ <FriendlyName>Foo</FriendlyName>
524
+ <PhoneNumber>+15105555555</PhoneNumber>
525
+ <DateCreated>Tue, 27 Jul 2010 20:21:11 +0000</DateCreated>
526
+ <DateUpdated>Tue, 27 Jul 2010 20:21:11 +0000</DateUpdated>
527
+ <Uri>/2010-04-01/Accounts/AC228ba7a5fe4238be081ea6f3c44186f3/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3</Uri>
528
+ </OutgoingCallerId>
529
+ </OutgoingCallerIds>
530
+ </TwilioResponse>
339
531
  END
340
532
  end
341
533
 
metadata CHANGED
@@ -1,52 +1,41 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twilio_resource
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 0
9
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Justin Weiss
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-02-16 00:00:00 -08:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-03-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: reactive_resource
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70218984544920 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 5
31
- - 1
32
- version: 0.5.1
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.7.0
33
22
  type: :runtime
34
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *70218984544920
35
25
  description:
36
26
  email: justin@uberweiss.org
37
27
  executables: []
38
-
39
28
  extensions: []
40
-
41
- extra_rdoc_files:
29
+ extra_rdoc_files:
42
30
  - README.md
43
- files:
31
+ files:
44
32
  - lib/twilio_resource/account.rb
45
33
  - lib/twilio_resource/base.rb
46
34
  - lib/twilio_resource/call.rb
47
35
  - lib/twilio_resource/exceptions.rb
48
36
  - lib/twilio_resource/incoming_phone_number.rb
49
37
  - lib/twilio_resource/local_incoming_phone_number.rb
38
+ - lib/twilio_resource/outgoing_caller_id.rb
50
39
  - lib/twilio_resource/toll_free_incoming_phone_number.rb
51
40
  - lib/twilio_resource/twilio_format.rb
52
41
  - lib/twilio_resource.rb
@@ -54,45 +43,39 @@ files:
54
43
  - test/call_test.rb
55
44
  - test/incoming_phone_number_test.rb
56
45
  - test/local_incoming_phone_number_test.rb
46
+ - test/outgoing_caller_id_test.rb
57
47
  - test/test_helper.rb
58
48
  - test/toll_free_incoming_phone_number_test.rb
59
49
  - test/twilio_mock.rb
60
50
  - README.md
61
- has_rdoc: true
62
51
  homepage: http://github.com/justinweiss/twilio_resource
63
52
  licenses: []
64
-
65
53
  post_install_message:
66
54
  rdoc_options: []
67
-
68
- require_paths:
55
+ require_paths:
69
56
  - lib
70
- required_ruby_version: !ruby/object:Gem::Requirement
57
+ required_ruby_version: !ruby/object:Gem::Requirement
71
58
  none: false
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- segments:
76
- - 0
77
- version: "0"
78
- required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
64
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- segments:
84
- - 0
85
- version: "0"
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
86
69
  requirements: []
87
-
88
70
  rubyforge_project:
89
- rubygems_version: 1.3.7
71
+ rubygems_version: 1.8.10
90
72
  signing_key:
91
73
  specification_version: 3
92
74
  summary: An ActiveResource API wrapper for Twilio
93
- test_files:
75
+ test_files:
94
76
  - test/account_test.rb
95
77
  - test/call_test.rb
96
78
  - test/incoming_phone_number_test.rb
97
79
  - test/local_incoming_phone_number_test.rb
80
+ - test/outgoing_caller_id_test.rb
98
81
  - test/toll_free_incoming_phone_number_test.rb