restcomm-ruby 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NGQ3YjU5ZGMyOWI5NjIxOTkwMTUzNTQyZmI1ZjExMGIzNTFkZDY1Ng==
5
+ data.tar.gz: !binary |-
6
+ ZDMxZjE2YjYwMzg2MmMyNTY5MzJhOWU5Nzk1MWQ4MjViOWQ3NzY1Yg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NjMwOTMwMTA5ZDc4MjBlYmE2NzY3OTBiYjE0NmNiMWFlZmM5YzRlYWFkZWVh
10
+ MTc1NWUyMjA4ZDQ2ODZhZWI3MzFhN2IyYmExYjhhZWJiNjVhYTQyYTEzZjhm
11
+ YTI1Y2MzYWQyZmY0YjdiYzZmZDI5ODRkNzYyYThkOWU0OTkyM2I=
12
+ data.tar.gz: !binary |-
13
+ MGM4YTk2MGNlMGFhYTMwNmI3MjdiMDE3OGFiMmI0NjdkZDk2MjRmODMyNGNk
14
+ ZTEzZmQyNjRjOTdiZjgyMGNjZWYzNDNiYjlkYTU2NDA1ZmI4M2NiMDlkMzkz
15
+ ZmEwN2EwNDI3OTE2YmZhOTMwZTc3MWUyNjZkMjBmZGM3NDAwODE=
data/CHANGES.md CHANGED
@@ -1,171 +1,11 @@
1
1
  restcomm-ruby changelog
2
2
  =====================
3
3
 
4
- Version 3.15.1
4
+ Version 1.2.0
5
5
  --------------
6
6
 
7
- Released February 18, 2015
7
+ Released March 2015
8
8
 
9
- - For real this time, add TaskRouterClient object and resources for new TaskRouter API
9
+ - First iteration of the app based on the twilio-ruby helper
10
10
 
11
- Version 3.15.0
12
- --------------
13
-
14
- Released February 18, 2015
15
-
16
- - Adds TaskRouterClient object and resources for new TaskRouter API
17
-
18
- Version 3.14.5
19
- --------------
20
-
21
- Released February 9, 2015
22
-
23
- - Relaxes JWT gem version requirement
24
- - Adds Ruby 2.2.0 testing to TravisCI
25
-
26
- Version 3.14.4
27
- --------------
28
-
29
- Released January 8, 2015
30
-
31
- - Feature: dynamically choose the auth token to validate requests with when using the RestcommWebhookAuthentication middleware.
32
- - Deprecation: The Restcomm::REST::SMS::Message resource is deprecated.
33
- - More fixing of docs
34
-
35
- Version 3.14.3
36
- --------------
37
-
38
- Released January 8, 2015
39
-
40
- - Fix nil error in RequestValidator middleware
41
- - Fix up docs
42
-
43
- Version 3.14.2
44
- --------------
45
-
46
- Released November 24, 2014
47
-
48
- - Fixed incomplete token support
49
-
50
- Version 3.14.1
51
- --------------
52
-
53
- Released November 21, 2014
54
-
55
- - Add support for the new Tokens endpoint
56
-
57
- Version 3.14.0
58
- --------------
59
-
60
- Released November 13, 2014
61
-
62
- - Switch to a constant-time string comparison for RCML request signature validation
63
- - Add support for Call and Message deletion/redaction
64
-
65
- Version 3.13.1
66
- --------------
67
-
68
- Released October 1, 2014
69
-
70
- - Bump required version to 1.9.3
71
-
72
- Version 3.13.0
73
- --------------
74
-
75
- Released September 23, 2014
76
-
77
- - Deprecates 1.8.7 support
78
- - Internal code style changes including:
79
- - change symbol hash syntax to Ruby 1.9 style
80
- - remove curly braces from hash arguments to methods
81
- - add spaces around curly braces in blocks
82
- - reduces all lines to less than 80 characters
83
-
84
- Version 3.12.3
85
- --------------
86
-
87
- Released September 23, 2014
88
-
89
- - Added block configure syntax
90
-
91
- Version 3.12.2
92
- --------------
93
-
94
- Released August 29, 2014
95
-
96
- - `client.account.{resource}` can now be accessed with `client.{resource}`
97
- - Many doc updates
98
-
99
- Version 3.12.1
100
- --------------
101
-
102
- Released August 26, 2014
103
-
104
- - Add support for new call feedback endpoints
105
-
106
- Version 3.12.0
107
- --------------
108
-
109
- Released August 18, 2014
110
-
111
- - Add Rack middleware for Restcomm request-signature validation
112
- - Upgrade dependencies and clean up project files
113
- - Documentation fixes
114
- - Add `text` alias for `to_xml` method on RCML generator objects
115
-
116
- Version 3.11.6
117
- --------------
118
-
119
- Released July 25, 2014
120
-
121
- - Add #to_xml to RCML Responses.
122
- - Updated test / development dependencies.
123
- - Updated to RSpec 3 syntax.
124
-
125
- Version 3.11.5
126
- --------------
127
-
128
- Released February 4, 2014
129
-
130
- - Add bangs for restify to indicate it's a dangerous operation.
131
- - Remove reference to deprecated OpenSSL Digest parameter.
132
- - Encode dates properly before passing them to the Restcomm API.
133
-
134
- Version 3.11.4
135
- --------------
136
-
137
- Released October 21, 2013
138
-
139
- - Add support for listing IncomingPhoneNumbers by type.
140
- - Add support for searching for mobile enabled numbers for
141
- both IncomingPhoneNumbers and AvailablePhoneNumbers.
142
-
143
- Version 3.11.3
144
- --------------
145
-
146
- Released October 15, 2013
147
-
148
- - Restore support for versions of Ruby other than 2.0.0, which the
149
- previous release removed.
150
-
151
- Version 3.11.2
152
-
153
- Released October 15, 2013
154
-
155
- - Restore ability of `sms.messages` to make requests to /SMS/Messages.
156
-
157
- Version 3.11.1
158
- --------------
159
-
160
- Released September 24, 2013
161
-
162
- - Fix a bug causing request the new messages class to fail.
163
-
164
- Version 3.11.0
165
- -------------
166
-
167
- Released September 18, 2013
168
11
 
169
- - Add MMS support.
170
- - Add SIP-In support.
171
- - Add docs.
@@ -122,7 +122,14 @@ require 'active_support/all'
122
122
  end
123
123
 
124
124
  if response.body and !response.body.empty?
125
- object = MultiJson.load(response.body)
125
+
126
+
127
+ if response.body.include? ("<RestcommResponse>")
128
+ m = Hash.from_xml(response.body).to_json
129
+ object = MultiJson.load(m)
130
+ else
131
+ object = MultiJson.load(response.body)
132
+ end
126
133
  end
127
134
 
128
135
  if response.kind_of? Net::HTTPClientError
@@ -282,6 +289,10 @@ require 'active_support/all'
282
289
  path.gsub!("/Recordings.json", ".json")
283
290
  end
284
291
 
292
+ if path.include?("/Accounts/#{@account_sid}/AvailablePhoneNumbers/US/Local.json" )
293
+ path.gsub!("/AvailablePhoneNumbers/US/Local.json", "/AvailablePhoneNumbers/US/Local")
294
+ end
295
+
285
296
  if path.include?("/Accounts/#{@account_sid}.json" )
286
297
  path.gsub!("/Accounts/#{@account_sid}.json", "/Accounts.json/#{@account_sid}")
287
298
  end
@@ -55,22 +55,29 @@ module Restcomm
55
55
 
56
56
  response = @client.get( @path, params, full_path)
57
57
 
58
-
59
- if @list_key == "calls"
58
+ if @list_key == "calls"
60
59
  resources = response[@list_key]
61
- elsif @list_key == "recordings"
62
- resources = response
63
- else
64
- resources = response
65
- end
60
+ elsif @list_key == "recordings"
61
+ resources = response
62
+
63
+ else
64
+ resources = response
65
+ end
66
66
 
67
+ #raise "********#{@instance_class}*******#{resources[0]["FriendlyName"]}***************"
67
68
  path = full_path ? @path.split('.')[0] : @path
68
69
 
69
- resource_list = resources.map do |resource|
70
- @instance_class.new("#{path}/#{resource[@instance_id_key]}", @client, resource)
70
+ if @list_key == "available_phone_numbers"
71
+ resources = response["RestcommResponse"]["AvailablePhoneNumbers"]["AvailablePhoneNumber"]
72
+ resource_list = resources.map do |resource|
73
+ @instance_class.new("#{path}/#{resource[@instance_id_key]}", @client, resource)
74
+ end
75
+ else
76
+ resource_list = resources.map do |resource|
77
+ @instance_class.new("#{path}/#{resource[@instance_id_key]}", @client, resource)
78
+ end
71
79
  end
72
80
 
73
-
74
81
  # set the +total+ and +next_page+ properties on the array
75
82
  client, list_class = @client, self.class
76
83
  resource_list.instance_eval do
@@ -1,3 +1,3 @@
1
1
  module Restcomm
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -6,11 +6,11 @@ require 'restcomm-ruby/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'restcomm-ruby'
8
8
  spec.version = Restcomm::VERSION
9
- spec.authors = ['Andrew Benton']
10
- spec.email = ['andrew@twilio.com']
9
+ spec.authors = ['Charles Roufay']
10
+ spec.email = ['info@telestax.com']
11
11
  spec.summary = 'A simple library for communicating with the Restcomm REST API, building RCML, and generating Restcomm Client Capability Tokens'
12
12
  spec.description = 'A simple library for communicating with the Restcomm REST API, building RCML, and generating Restcomm Client Capability Tokens'
13
- spec.homepage = 'http://github.com/restcomm/restcomm-ruby'
13
+ spec.homepage = 'https://github.com/Mobicents/restcomm-ruby'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restcomm-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.2.1
6
5
  platform: ruby
7
6
  authors:
8
- - Andrew Benton
7
+ - Charles Roufay
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-03-23 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: multi_json
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: builder
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: jwt
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,7 @@ dependencies:
78
69
  description: A simple library for communicating with the Restcomm REST API, building
79
70
  RCML, and generating Restcomm Client Capability Tokens
80
71
  email:
81
- - andrew@twilio.com
72
+ - info@telestax.com
82
73
  executables: []
83
74
  extensions: []
84
75
  extra_rdoc_files:
@@ -233,9 +224,10 @@ files:
233
224
  - spec/util/configuration_spec.rb
234
225
  - spec/util/request_validator_spec.rb
235
226
  - spec/util/url_encode_spec.rb
236
- homepage: http://github.com/restcomm/restcomm-ruby
227
+ homepage: https://github.com/Mobicents/restcomm-ruby
237
228
  licenses:
238
229
  - MIT
230
+ metadata: {}
239
231
  post_install_message:
240
232
  rdoc_options:
241
233
  - --line-numbers
@@ -247,25 +239,20 @@ rdoc_options:
247
239
  require_paths:
248
240
  - lib
249
241
  required_ruby_version: !ruby/object:Gem::Requirement
250
- none: false
251
242
  requirements:
252
243
  - - ! '>='
253
244
  - !ruby/object:Gem::Version
254
245
  version: 1.9.3
255
246
  required_rubygems_version: !ruby/object:Gem::Requirement
256
- none: false
257
247
  requirements:
258
248
  - - ! '>='
259
249
  - !ruby/object:Gem::Version
260
250
  version: '0'
261
- segments:
262
- - 0
263
- hash: -714380754024375497
264
251
  requirements: []
265
252
  rubyforge_project:
266
- rubygems_version: 1.8.25
253
+ rubygems_version: 2.4.6
267
254
  signing_key:
268
- specification_version: 3
255
+ specification_version: 4
269
256
  summary: A simple library for communicating with the Restcomm REST API, building RCML,
270
257
  and generating Restcomm Client Capability Tokens
271
258
  test_files: