mobile-subscriber 1.0.0.alpha4 → 1.0.0.alpha5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mobile-subscriber.rb +13 -3
  3. data/lib/mobile_subscriber/dictionaries/dialing_and_country_codes.rb +468 -28
  4. data/lib/mobile_subscriber/http/known_imsi_headers.rb +22 -0
  5. data/lib/mobile_subscriber/http/known_msisdn_headers.rb +68 -0
  6. data/lib/mobile_subscriber/http/request_info.rb +166 -0
  7. data/lib/mobile_subscriber/identity.rb +97 -1
  8. data/lib/mobile_subscriber/version.rb +1 -1
  9. data/mobile_subscriber.thor +41 -0
  10. data/spec/factories/mobile_requests.rb +28 -0
  11. data/spec/factories/mobile_requests_from_claro.rb +257 -0
  12. data/spec/factories/mobile_requests_from_iusacell.rb +13 -0
  13. data/spec/factories/mobile_requests_from_movistar.rb +15 -0
  14. data/spec/factories/mobile_requests_from_telcel.rb +14 -0
  15. data/spec/factories/mobile_requests_from_vivo.rb +13 -0
  16. data/spec/features/claro_user_detection_spec.rb +170 -0
  17. data/spec/features/iusacell_user_detection_spec.rb +19 -0
  18. data/spec/features/movistar_user_detection_spec.rb +19 -0
  19. data/spec/features/telcel_user_detection_spec.rb +19 -0
  20. data/spec/models/{isdn_spec.rb → identity_spec.rb} +5 -5
  21. data/spec/shared_examples/identity_detection_in_argentina.rb +11 -0
  22. data/spec/shared_examples/identity_detection_in_brazil.rb +12 -0
  23. data/spec/shared_examples/identity_detection_in_chile.rb +12 -0
  24. data/spec/shared_examples/identity_detection_in_colombia.rb +12 -0
  25. data/spec/shared_examples/identity_detection_in_costa_rica.rb +15 -0
  26. data/spec/shared_examples/identity_detection_in_dominican_republic.rb +12 -0
  27. data/spec/shared_examples/identity_detection_in_ecuador.rb +12 -0
  28. data/spec/shared_examples/identity_detection_in_el_salvador.rb +15 -0
  29. data/spec/shared_examples/identity_detection_in_guatemala.rb +15 -0
  30. data/spec/shared_examples/identity_detection_in_honduras.rb +11 -0
  31. data/spec/shared_examples/identity_detection_in_mexico.rb +11 -0
  32. data/spec/shared_examples/identity_detection_in_nicaragua.rb +12 -0
  33. data/spec/shared_examples/identity_detection_in_panama.rb +12 -0
  34. data/spec/shared_examples/identity_detection_in_peru.rb +12 -0
  35. data/spec/shared_examples/identity_detection_in_puerto_rico.rb +14 -0
  36. data/spec/shared_examples/of_msisdn_detection_from_http_request.rb +3 -188
  37. data/templates/dialing_and_country_codes.rb.erb +20 -0
  38. metadata +58 -28
  39. data/lib/mobile_subscriber/detection/from_msisdn_http_request_header.rb +0 -48
  40. data/lib/mobile_subscriber/detection/from_x_nokia_msisdn_http_request_header.rb +0 -58
  41. data/lib/mobile_subscriber/detection/from_x_up_calling_line_id_http_request_header.rb +0 -65
  42. data/lib/mobile_subscriber/detection/from_x_up_ch_msisdn_http_request_header.rb +0 -35
  43. data/lib/mobile_subscriber/detection/from_x_up_subno_http_request_header.rb +0 -44
  44. data/lib/mobile_subscriber/detection/from_x_wap_msisdn_http_request_header.rb +0 -37
  45. data/lib/mobile_subscriber/detection/from_x_wap_sesiones3g_mdn_http_request_header.rb +0 -39
  46. data/lib/mobile_subscriber/detection/from_x_ztgo_beareraddress_http_request_header.rb +0 -36
  47. data/lib/mobile_subscriber/detection/http_request_info.rb +0 -77
  48. data/lib/mobile_subscriber/isdn.rb +0 -89
  49. data/spec/detection/from_msisdn_http_request_header_spec.rb +0 -53
  50. data/spec/detection/from_x_nokia_msisdn_http_request_header_spec.rb +0 -99
  51. data/spec/detection/from_x_up_calling_line_id_http_request_header_spec.rb +0 -39
  52. data/spec/detection/from_x_up_subno_http_request_header_spec.rb +0 -43
  53. data/spec/detection/from_x_wap_msisdn_http_request_header_spec.rb +0 -32
  54. data/spec/detection/from_x_wap_sesiones3g_mdn_http_request_header_spec.rb +0 -29
  55. data/spec/factories/requests.rb +0 -229
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples "of mobile subcriber identity detection from a valid honduran mobile network http request" do
4
+
5
+ it "the msisdn starts with '504'" do
6
+ expect(subject.msisdn).to start_with '504'
7
+ end
8
+ it "the mobile country code is '708'" do
9
+ expect(subject.mobile_country_code).to eq '708'
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples "of mobile subcriber identity detection from a valid mexican mobile network http request" do
4
+
5
+ it "the msisdn starts with '52'" do
6
+ expect(subject.msisdn).to start_with '52'
7
+ end
8
+ it "the mobile country code is '334'" do
9
+ expect(subject.mobile_country_code).to eq '334'
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples "of mobile subcriber identity detection from a valid nicaraguan mobile network http request" do
4
+
5
+ it "the msisdn starts with '505'" do
6
+ expect(subject.msisdn).to start_with '505'
7
+ end
8
+
9
+ it "the mobile country code is '710'" do
10
+ expect(subject.mobile_country_code).to eq '710'
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples "of mobile subcriber identity detection from a valid panamanian mobile network http request" do
4
+
5
+ it "the msisdn starts with '507'" do
6
+ expect(subject.msisdn).to start_with '507'
7
+ end
8
+
9
+ it "the mobile country code is '714'" do
10
+ expect(subject.mobile_country_code).to eq '714'
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples "of mobile subcriber identity detection from a valid peruvian mobile network http request" do
4
+
5
+ it "the msisdn starts with '51'" do
6
+ expect(subject.msisdn).to start_with '51'
7
+ end
8
+
9
+ it "the mobile country code is '716'" do
10
+ expect(subject.mobile_country_code).to eq '716'
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ shared_examples "of mobile subcriber identity detection from a valid puerto rican mobile network http request" do
4
+
5
+
6
+
7
+ it "the msisdn starts with '1787'" do
8
+ expect(subject.msisdn).to start_with '1'
9
+ end
10
+
11
+ it "the mobile country code is '330'" do
12
+ expect(subject.mobile_country_code).to eq '330'
13
+ end
14
+ end
@@ -1,192 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
- shared_examples "of detection of msisdn from a valid mobile network http request" do
4
- it "is not nil" do
5
- expect(subject).not_to be_nil
6
- end
7
- it "is not blank" do
8
- expect(subject).not_to be_blank
9
- end
10
-
11
- it "has an :id key" do
12
- expect(subject).to have_key :id
13
- end
14
- it "has a non-blank :id value" do
15
- expect(subject[:id]).not_to be_blank
16
- end
17
-
18
- it "has an :mobile_country_code key" do
19
- expect(subject).to have_key :mobile_country_code
20
- end
21
- it "has a non-blank :mobile_country_code value" do
22
- expect(subject[:mobile_country_code]).not_to be_blank
23
- end
24
-
25
- it "has an :mobile_network_code key" do
26
- expect(subject).to have_key :mobile_network_code
27
- end
28
- it "has a non-blank :mobile_network_code value" do
29
- expect(subject[:mobile_network_code]).not_to be_blank
30
- end
31
- end
32
-
33
- shared_examples "of detection of msisdn from a valid argentinian mobile network http request" do
34
- include_examples "of detection of msisdn from a valid mobile network http request"
35
- it "has an :id value that starts with '54'" do
36
- expect(subject[:id]).to match /\A54/
37
- end
38
- it "has a :mobile_country_code value of '722'" do
39
- expect(subject[:mobile_country_code]).to eq '722'
40
- end
41
- end
42
-
43
- shared_examples "of detection of msisdn from a valid mexican mobile network http request" do
44
- include_examples "of detection of msisdn from a valid mobile network http request"
45
- it "has an :id value that starts with '52'" do
46
- expect(subject[:id]).to match /\A52/
47
- end
48
- it "has a :mobile_country_code value of '334'" do
49
- expect(subject[:mobile_country_code]).to eq '334'
50
- end
51
- end
52
-
53
- shared_examples "of detection of msisdn from a valid guatemalan mobile network http request" do
54
- include_examples "of detection of msisdn from a valid mobile network http request"
55
- it "has an :id value that starts with '502'" do
56
- expect(subject[:id]).to match /\A502/
57
- end
58
- it "has a :mobile_country_code value of '704'" do
59
- expect(subject[:mobile_country_code]).to eq '704'
60
- end
61
- end
62
-
63
- shared_examples "of detection of msisdn from a valid honduran mobile network http request" do
64
- include_examples "of detection of msisdn from a valid mobile network http request"
65
- it "has an :id value that starts with '504'" do
66
- expect(subject[:id]).to match /\A504/
67
- end
68
- it "has a :mobile_country_code value of '708'" do
69
- expect(subject[:mobile_country_code]).to eq '708'
70
- end
71
- end
72
-
73
- shared_examples "of detection of msisdn from a valid brazilian mobile network http request" do
74
- include_examples "of detection of msisdn from a valid mobile network http request"
75
- it "has an :id value that starts with '55'" do
76
- expect(subject[:id]).to match /\A55/
77
- end
78
-
79
- it "has a :mobile_country_code value of '724'" do
80
- expect(subject[:mobile_country_code]).to eq '724'
81
- end
82
- end
83
-
84
- shared_examples "of detection of msisdn from a valid chilean mobile network http request" do
85
- include_examples "of detection of msisdn from a valid mobile network http request"
86
- it "has an :id value that starts with '56'" do
87
- expect(subject[:id]).to match /\A56/
88
- end
89
-
90
- it "has a :mobile_country_code value of '730'" do
91
- expect(subject[:mobile_country_code]).to eq '730'
92
- end
93
- end
94
-
95
- shared_examples "of detection of msisdn from a valid salvadoran mobile network http request" do
96
- include_examples "of detection of msisdn from a valid mobile network http request"
97
- it "has an :id value that starts with '503'" do
98
- expect(subject[:id]).to match /\A503/
99
- end
100
-
101
- it "has a :mobile_country_code value of '706'" do
102
- expect(subject[:mobile_country_code]).to eq '706'
103
- end
104
- end
105
-
106
- shared_examples "of detection of msisdn from a valid costa rican mobile network http request" do
107
- include_examples "of detection of msisdn from a valid mobile network http request"
108
- it "has an :id value that starts with '506'" do
109
- expect(subject[:id]).to match /\A506/
110
- end
111
-
112
- it "has a :mobile_country_code value of '712'" do
113
- expect(subject[:mobile_country_code]).to eq '712'
114
- end
115
- end
116
-
117
- shared_examples "of detection of msisdn from a valid puerto rican mobile network http request" do
118
- include_examples "of detection of msisdn from a valid mobile network http request"
119
- it "has an :id value that starts with '1'" do
120
- expect(subject[:id]).to match /\A1/
121
- end
122
-
123
- it "has a :mobile_country_code value of '330'" do
124
- expect(subject[:mobile_country_code]).to eq '330'
125
- end
126
- end
127
-
128
- shared_examples "of detection of msisdn from a valid colombian mobile network http request" do
129
- include_examples "of detection of msisdn from a valid mobile network http request"
130
- it "has an :id value that starts with '57'" do
131
- expect(subject[:id]).to match /\A57/
132
- end
133
-
134
- it "has a :mobile_country_code value of '732'" do
135
- expect(subject[:mobile_country_code]).to eq '732'
136
- end
137
- end
138
-
139
- shared_examples "of detection of msisdn from a valid ecuadorian mobile network http request" do
140
- include_examples "of detection of msisdn from a valid mobile network http request"
141
- it "has an :id value that starts with '593'" do
142
- expect(subject[:id]).to match /\A593/
143
- end
144
-
145
- it "has a :mobile_country_code value of '740'" do
146
- expect(subject[:mobile_country_code]).to eq '740'
147
- end
148
- end
149
-
150
- shared_examples "of detection of msisdn from a valid dominican mobile network http request" do
151
- include_examples "of detection of msisdn from a valid mobile network http request"
152
- it "has an :id value that starts with '1809'" do
153
- expect(subject[:id]).to match /\A1809/
154
- end
155
-
156
- it "has a :mobile_country_code value of '370'" do
157
- expect(subject[:mobile_country_code]).to eq '370'
158
- end
159
- end
160
-
161
- shared_examples "of detection of msisdn from a valid nicaraguan mobile network http request" do
162
- include_examples "of detection of msisdn from a valid mobile network http request"
163
- it "has an :id value that starts with '505'" do
164
- expect(subject[:id]).to match /\A505/
165
- end
166
-
167
- it "has a :mobile_country_code value of '710'" do
168
- expect(subject[:mobile_country_code]).to eq '710'
169
- end
170
- end
171
-
172
- shared_examples "of detection of msisdn from a valid panamanian mobile network http request" do
173
- include_examples "of detection of msisdn from a valid mobile network http request"
174
- it "has an :id value that starts with '507'" do
175
- expect(subject[:id]).to match /\A507/
176
- end
177
-
178
- it "has a :mobile_country_code value of '714'" do
179
- expect(subject[:mobile_country_code]).to eq '714'
180
- end
181
- end
182
-
183
- shared_examples "of detection of msisdn from a valid peruvian mobile network http request" do
184
- include_examples "of detection of msisdn from a valid mobile network http request"
185
- it "has an :id value that starts with '51'" do
186
- expect(subject[:id]).to match /\A51/
187
- end
188
-
189
- it "has a :mobile_country_code value of '716'" do
190
- expect(subject[:mobile_country_code]).to eq '716'
3
+ shared_examples "of mobile subcriber identity detection from a valid mobile network http request" do
4
+ it "is present" do
5
+ expect(subject).to be_present
191
6
  end
192
7
  end
@@ -0,0 +1,20 @@
1
+ module MobileSubscriber
2
+
3
+ # Country Dialing => ISO codes:
4
+ DIALING_COUNTRY_CODES = {
5
+
6
+ # Codes collected from http://countrycode.org
7
+ <% @country_code_data.each do |d| %>
8
+ '<%= d[:dialing_code] %>' => '<%= d[:iso_code_2] %>', # <%= d[:country_name] %>
9
+ <% end %>
10
+
11
+ # TODO: Block 1 countries:
12
+ '1787' => 'PR',
13
+
14
+ # Special cases:
15
+ # Boy! Caribbean Islands' codes do get messy!
16
+ '1829' => 'DO', # Dominican Republic Overlay 1
17
+ '1849' => 'DO', # Dominican Republic Overlay 2
18
+
19
+ }.freeze
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobile-subscriber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha4
4
+ version: 1.0.0.alpha5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Quintanilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-25 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -113,34 +113,46 @@ files:
113
113
  - build-docker.sh
114
114
  - fig.yml
115
115
  - lib/mobile-subscriber.rb
116
- - lib/mobile_subscriber/detection/from_msisdn_http_request_header.rb
117
- - lib/mobile_subscriber/detection/from_x_nokia_msisdn_http_request_header.rb
118
- - lib/mobile_subscriber/detection/from_x_up_calling_line_id_http_request_header.rb
119
- - lib/mobile_subscriber/detection/from_x_up_ch_msisdn_http_request_header.rb
120
- - lib/mobile_subscriber/detection/from_x_up_subno_http_request_header.rb
121
- - lib/mobile_subscriber/detection/from_x_wap_msisdn_http_request_header.rb
122
- - lib/mobile_subscriber/detection/from_x_wap_sesiones3g_mdn_http_request_header.rb
123
- - lib/mobile_subscriber/detection/from_x_ztgo_beareraddress_http_request_header.rb
124
- - lib/mobile_subscriber/detection/http_request_info.rb
125
116
  - lib/mobile_subscriber/dictionaries/dialing_and_country_codes.rb
126
117
  - lib/mobile_subscriber/dictionaries/mobile_and_iso_country_codes.rb
127
118
  - lib/mobile_subscriber/dictionaries/operator_data.rb
119
+ - lib/mobile_subscriber/http/known_imsi_headers.rb
120
+ - lib/mobile_subscriber/http/known_msisdn_headers.rb
121
+ - lib/mobile_subscriber/http/request_info.rb
128
122
  - lib/mobile_subscriber/identity.rb
129
- - lib/mobile_subscriber/isdn.rb
130
123
  - lib/mobile_subscriber/version.rb
131
124
  - mobile-subscriber.gemspec
132
125
  - mobile_subscriber.thor
133
- - spec/detection/from_msisdn_http_request_header_spec.rb
134
- - spec/detection/from_x_nokia_msisdn_http_request_header_spec.rb
135
- - spec/detection/from_x_up_calling_line_id_http_request_header_spec.rb
136
- - spec/detection/from_x_up_subno_http_request_header_spec.rb
137
- - spec/detection/from_x_wap_msisdn_http_request_header_spec.rb
138
- - spec/detection/from_x_wap_sesiones3g_mdn_http_request_header_spec.rb
139
- - spec/factories/requests.rb
126
+ - spec/factories/mobile_requests.rb
127
+ - spec/factories/mobile_requests_from_claro.rb
128
+ - spec/factories/mobile_requests_from_iusacell.rb
129
+ - spec/factories/mobile_requests_from_movistar.rb
130
+ - spec/factories/mobile_requests_from_telcel.rb
131
+ - spec/factories/mobile_requests_from_vivo.rb
132
+ - spec/features/claro_user_detection_spec.rb
133
+ - spec/features/iusacell_user_detection_spec.rb
134
+ - spec/features/movistar_user_detection_spec.rb
135
+ - spec/features/telcel_user_detection_spec.rb
140
136
  - spec/mobile_subscriber_spec.rb
141
- - spec/models/isdn_spec.rb
137
+ - spec/models/identity_spec.rb
138
+ - spec/shared_examples/identity_detection_in_argentina.rb
139
+ - spec/shared_examples/identity_detection_in_brazil.rb
140
+ - spec/shared_examples/identity_detection_in_chile.rb
141
+ - spec/shared_examples/identity_detection_in_colombia.rb
142
+ - spec/shared_examples/identity_detection_in_costa_rica.rb
143
+ - spec/shared_examples/identity_detection_in_dominican_republic.rb
144
+ - spec/shared_examples/identity_detection_in_ecuador.rb
145
+ - spec/shared_examples/identity_detection_in_el_salvador.rb
146
+ - spec/shared_examples/identity_detection_in_guatemala.rb
147
+ - spec/shared_examples/identity_detection_in_honduras.rb
148
+ - spec/shared_examples/identity_detection_in_mexico.rb
149
+ - spec/shared_examples/identity_detection_in_nicaragua.rb
150
+ - spec/shared_examples/identity_detection_in_panama.rb
151
+ - spec/shared_examples/identity_detection_in_peru.rb
152
+ - spec/shared_examples/identity_detection_in_puerto_rico.rb
142
153
  - spec/shared_examples/of_msisdn_detection_from_http_request.rb
143
154
  - spec/spec_helper.rb
155
+ - templates/dialing_and_country_codes.rb.erb
144
156
  - templates/mobile_and_iso_country_codes.rb.erb
145
157
  - templates/operator_data.rb.erb
146
158
  homepage: ''
@@ -168,14 +180,32 @@ signing_key:
168
180
  specification_version: 4
169
181
  summary: Mobile MSISDN detection & validation.
170
182
  test_files:
171
- - spec/detection/from_msisdn_http_request_header_spec.rb
172
- - spec/detection/from_x_nokia_msisdn_http_request_header_spec.rb
173
- - spec/detection/from_x_up_calling_line_id_http_request_header_spec.rb
174
- - spec/detection/from_x_up_subno_http_request_header_spec.rb
175
- - spec/detection/from_x_wap_msisdn_http_request_header_spec.rb
176
- - spec/detection/from_x_wap_sesiones3g_mdn_http_request_header_spec.rb
177
- - spec/factories/requests.rb
183
+ - spec/factories/mobile_requests.rb
184
+ - spec/factories/mobile_requests_from_claro.rb
185
+ - spec/factories/mobile_requests_from_iusacell.rb
186
+ - spec/factories/mobile_requests_from_movistar.rb
187
+ - spec/factories/mobile_requests_from_telcel.rb
188
+ - spec/factories/mobile_requests_from_vivo.rb
189
+ - spec/features/claro_user_detection_spec.rb
190
+ - spec/features/iusacell_user_detection_spec.rb
191
+ - spec/features/movistar_user_detection_spec.rb
192
+ - spec/features/telcel_user_detection_spec.rb
178
193
  - spec/mobile_subscriber_spec.rb
179
- - spec/models/isdn_spec.rb
194
+ - spec/models/identity_spec.rb
195
+ - spec/shared_examples/identity_detection_in_argentina.rb
196
+ - spec/shared_examples/identity_detection_in_brazil.rb
197
+ - spec/shared_examples/identity_detection_in_chile.rb
198
+ - spec/shared_examples/identity_detection_in_colombia.rb
199
+ - spec/shared_examples/identity_detection_in_costa_rica.rb
200
+ - spec/shared_examples/identity_detection_in_dominican_republic.rb
201
+ - spec/shared_examples/identity_detection_in_ecuador.rb
202
+ - spec/shared_examples/identity_detection_in_el_salvador.rb
203
+ - spec/shared_examples/identity_detection_in_guatemala.rb
204
+ - spec/shared_examples/identity_detection_in_honduras.rb
205
+ - spec/shared_examples/identity_detection_in_mexico.rb
206
+ - spec/shared_examples/identity_detection_in_nicaragua.rb
207
+ - spec/shared_examples/identity_detection_in_panama.rb
208
+ - spec/shared_examples/identity_detection_in_peru.rb
209
+ - spec/shared_examples/identity_detection_in_puerto_rico.rb
180
210
  - spec/shared_examples/of_msisdn_detection_from_http_request.rb
181
211
  - spec/spec_helper.rb
@@ -1,48 +0,0 @@
1
- require 'mobile_subscriber/dictionaries/dialing_and_country_codes'
2
-
3
- module MobileSubscriber::Detection
4
-
5
- # Módulo que provee métodos de detección y validacion para MSISDN por el
6
- # header de HTTP 'Msisdn':
7
- # - Claro Brasil
8
- # - Claro República Dominicana
9
- # - Claro Ecuador
10
- # - Claro Paraguay
11
- module FromMsisdnHttpRequestHeader
12
-
13
- def extract_from_msisdn_http_request_header(http_request_info)
14
- if msisdn = http_request_info.headers['Msisdn'] and msisdn.length >= 8
15
-
16
- country_code = (
17
- MobileSubscriber::DIALING_COUNTRY_CODES[msisdn[0,2]] ||
18
- MobileSubscriber::DIALING_COUNTRY_CODES[msisdn[0,3]] ||
19
- MobileSubscriber::DIALING_COUNTRY_CODES[msisdn[0,4]] # Dominican Republic
20
- )
21
-
22
- # Determine the Network Operator (MCC + MNC tuple):
23
- # TODO: Validate IP ranges, additional headers, etc.
24
- network_id_tuple = case country_code
25
- when 'BR' # Claro Brasil
26
- # TODO: Determine (if possible) the MNC (05, 38)
27
- { mcc: "724", mnc: "05" }
28
- when 'DO' # Claro Dominicana:
29
- { mcc: "370", mnc: "02" }
30
- when 'EC' # Claro Ecuador:
31
- { mcc: "740", mnc: "01" }
32
- when 'PY' # Claro Paraguay:
33
- { mcc: "744", mnc: "02" }
34
- end
35
-
36
- # Return only if we identified the network:
37
- if network_id_tuple.present?
38
- {
39
- id: msisdn,
40
- mobile_country_code: network_id_tuple[:mcc],
41
- mobile_network_code: network_id_tuple[:mnc],
42
- http_request_info: http_request_info
43
- }
44
- end
45
- end
46
- end
47
- end
48
- end