didww-v3 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +1 -1
- data/CHANGELOG.md +15 -0
- data/FILTERS.md +258 -0
- data/README.md +4 -0
- data/didww-v3.gemspec +13 -8
- data/examples/README.md +1 -0
- data/examples/voice_in_trunk_sip_registration.rb +83 -0
- data/lib/didww/complex_objects/capacity_order_item.rb +1 -1
- data/lib/didww/complex_objects/configurations/sip_configuration.rb +8 -6
- data/lib/didww/complex_objects/did_order_item.rb +1 -1
- data/lib/didww/resource/did_reservation.rb +4 -0
- data/lib/didww/resource/voice_out_trunk.rb +1 -0
- data/lib/didww/version.rb +1 -1
- metadata +37 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cadaea9315bfa69aa413d4cbec93d08d877e538f4423141f95beda30a1242ecb
|
|
4
|
+
data.tar.gz: 1600bdbbf304e00e80b970f289ca1bdc18b77b452baec09f08799ce70ce0750f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aad1243da599c25fbe2d0411804ccdcee166830ca547bab18df176f2c15fb1cc9165e158ded14a1314d626a79078fa13e07d99b57bb04327c5a5baa244aa006d
|
|
7
|
+
data.tar.gz: f1a754028e725b7d24048baa7326f46280c5f84c93939ec1e486f10dd1a9f3e98a5d1574ed79d273250acde87b7f0eb36877275c46e042374608d214017fe24f
|
data/.github/workflows/tests.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [6.2.0] - 2026-06-14
|
|
8
|
+
### Added
|
|
9
|
+
- `VoiceOutTrunk#rtp_ping` (boolean) — exposes the outbound trunk RTP ping toggle.
|
|
10
|
+
- `DidReservation#description` (string) — customer-supplied note attached to a reservation.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Relaxed the `json_api_client` dependency from the exact pin `1.23.0` to `~> 1.23`, allowing `1.24.0`. This unblocks installation on **Ruby 4.0**: the old exact pin transitively forced `faraday-gzip < 3.0`, whose `required_ruby_version < 4` made bundler resolution fail on Ruby 4. `json_api_client 1.24.0` raised the cap to `faraday-gzip < 4.0` (allowing `3.x`, which supports Ruby 4). CI now exercises Ruby 4.0 against activesupport 7.2 / 8.0 / 8.1. (#89)
|
|
14
|
+
|
|
15
|
+
## [6.1.1] - 2026-05-04
|
|
16
|
+
### Fixed
|
|
17
|
+
- `SipConfiguration#enabled_sip_registration = true` now always emits `host: null` and `port: null` on the wire, not only when the local attribute hash already had them set. The previous conditional cascade (introduced in 6.1.0) silently no-op'd when re-enabling SIP registration on an existing trunk through a fresh `SipConfiguration` instance: the PATCH body carried only `enabled_sip_registration: true`, the server merged it with the trunk's persisted host, and rejected with 422 (`host must be blank when the SIP registration is enabled`). Verified end-to-end against the live sandbox via the new `examples/voice_in_trunk_sip_registration.rb`.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- `examples/voice_in_trunk_sip_registration.rb` — end-to-end create / rename / disable / re-enable flow demonstrating every cascade rule against the sandbox API.
|
|
21
|
+
|
|
7
22
|
## [6.1.0] - 2026-05-04
|
|
8
23
|
### Added
|
|
9
24
|
- Complete the 2026-04-16 `SipConfiguration` attribute set that was missed during the 2026-04-16 rollout (and is not present in the public Postman collection — server form is the source of truth):
|
data/FILTERS.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# DIDWW 2026-04-16 — Server-side filter reference
|
|
2
|
+
|
|
3
|
+
This is the canonical list of `filter[KEY]` query parameters accepted by each list endpoint of the DIDWW API at version `2026-04-16` — the default API version targeted by this SDK.
|
|
4
|
+
|
|
5
|
+
The SDK passes filters through as untyped string→string maps (e.g. `DIDWW::Client.regions.where(iso: "US")`), so this document is the authoritative source for which keys actually do something on the server.
|
|
6
|
+
|
|
7
|
+
Every key listed here was verified live against the DIDWW API at version `2026-04-16`.
|
|
8
|
+
|
|
9
|
+
Pass values URL-encoded as strings. Where the server accepts arrays, comma-separate the values.
|
|
10
|
+
|
|
11
|
+
## AddressRequirement — `GET /v3/address_requirements`
|
|
12
|
+
|
|
13
|
+
- `filter[country.id]`
|
|
14
|
+
- `filter[did_group_type.id]`
|
|
15
|
+
|
|
16
|
+
## Address — `GET /v3/addresses`
|
|
17
|
+
|
|
18
|
+
- `filter[address]`
|
|
19
|
+
- `filter[address_contains]`
|
|
20
|
+
- `filter[area.id]`
|
|
21
|
+
- `filter[city.id]`
|
|
22
|
+
- `filter[city_name]`
|
|
23
|
+
- `filter[city_name_contains]`
|
|
24
|
+
- `filter[country.id]`
|
|
25
|
+
- `filter[description]`
|
|
26
|
+
- `filter[description_contains]`
|
|
27
|
+
- `filter[external_reference_id]`
|
|
28
|
+
- `filter[identity.external_reference_id]`
|
|
29
|
+
- `filter[identity.id]`
|
|
30
|
+
- `filter[postal_code]`
|
|
31
|
+
- `filter[postal_code_contains]`
|
|
32
|
+
|
|
33
|
+
## AddressVerification — `GET /v3/address_verifications`
|
|
34
|
+
|
|
35
|
+
- `filter[address.id]`
|
|
36
|
+
- `filter[address.identity.id]`
|
|
37
|
+
- `filter[external_reference_id]`
|
|
38
|
+
- `filter[reference]`
|
|
39
|
+
- `filter[reference_in]`
|
|
40
|
+
- `filter[status]`
|
|
41
|
+
|
|
42
|
+
## Area — `GET /v3/areas`
|
|
43
|
+
|
|
44
|
+
- `filter[country.id]`
|
|
45
|
+
- `filter[name]`
|
|
46
|
+
|
|
47
|
+
## AvailableDid — `GET /v3/available_dids`
|
|
48
|
+
|
|
49
|
+
- `filter[city.id]`
|
|
50
|
+
- `filter[country.id]`
|
|
51
|
+
- `filter[did_group.features]`
|
|
52
|
+
- `filter[did_group.id]`
|
|
53
|
+
- `filter[did_group.needs_registration]`
|
|
54
|
+
- `filter[did_group_type.id]`
|
|
55
|
+
- `filter[nanpa_prefix.id]`
|
|
56
|
+
- `filter[number_contains]`
|
|
57
|
+
- `filter[region.id]`
|
|
58
|
+
|
|
59
|
+
## CapacityPool — `GET /v3/capacity_pools`
|
|
60
|
+
|
|
61
|
+
- `filter[country.id]`
|
|
62
|
+
- `filter[has_unassigned_channels]`
|
|
63
|
+
- `filter[name]`
|
|
64
|
+
|
|
65
|
+
## City — `GET /v3/cities`
|
|
66
|
+
|
|
67
|
+
- `filter[area.id]`
|
|
68
|
+
- `filter[country.id]`
|
|
69
|
+
- `filter[is_available]`
|
|
70
|
+
- `filter[name]`
|
|
71
|
+
- `filter[region.id]`
|
|
72
|
+
|
|
73
|
+
## Country — `GET /v3/countries`
|
|
74
|
+
|
|
75
|
+
- `filter[is_available]`
|
|
76
|
+
- `filter[iso]`
|
|
77
|
+
- `filter[name]`
|
|
78
|
+
- `filter[prefix]`
|
|
79
|
+
|
|
80
|
+
## DidGroup — `GET /v3/did_groups`
|
|
81
|
+
|
|
82
|
+
- `filter[allow_additional_channels]`
|
|
83
|
+
- `filter[area_name]`
|
|
84
|
+
- `filter[available_dids_enabled]`
|
|
85
|
+
- `filter[city.id]`
|
|
86
|
+
- `filter[country.id]`
|
|
87
|
+
- `filter[did_group_type.id]`
|
|
88
|
+
- `filter[features]`
|
|
89
|
+
- `filter[is_available]`
|
|
90
|
+
- `filter[is_metered]`
|
|
91
|
+
- `filter[meta.total_count_gteq]`
|
|
92
|
+
- `filter[nanpa_prefix.id]`
|
|
93
|
+
- `filter[nanpa_prefix.npanxx]`
|
|
94
|
+
- `filter[needs_registration]`
|
|
95
|
+
- `filter[prefix]`
|
|
96
|
+
- `filter[region.id]`
|
|
97
|
+
|
|
98
|
+
## DidGroupType — `GET /v3/did_group_types`
|
|
99
|
+
|
|
100
|
+
- `filter[name]`
|
|
101
|
+
|
|
102
|
+
## DidHistory — `GET /v3/did_history`
|
|
103
|
+
|
|
104
|
+
- `filter[action]`
|
|
105
|
+
- `filter[created_at_gteq]`
|
|
106
|
+
- `filter[created_at_lteq]`
|
|
107
|
+
- `filter[did_number]`
|
|
108
|
+
- `filter[method]`
|
|
109
|
+
|
|
110
|
+
## DidReservation — `GET /v3/did_reservations`
|
|
111
|
+
|
|
112
|
+
- `filter[description]`
|
|
113
|
+
|
|
114
|
+
## Did — `GET /v3/dids`
|
|
115
|
+
|
|
116
|
+
- `filter[address_verification.id]`
|
|
117
|
+
- `filter[awaiting_registration]`
|
|
118
|
+
- `filter[billing_cycles_count]`
|
|
119
|
+
- `filter[blocked]`
|
|
120
|
+
- `filter[capacity_pool.id]`
|
|
121
|
+
- `filter[city.id]`
|
|
122
|
+
- `filter[country.id]`
|
|
123
|
+
- `filter[description]`
|
|
124
|
+
- `filter[did_group.features]`
|
|
125
|
+
- `filter[did_group.id]`
|
|
126
|
+
- `filter[emergency_calling_service.id]`
|
|
127
|
+
- `filter[emergency_enabled]`
|
|
128
|
+
- `filter[number]`
|
|
129
|
+
- `filter[order.id]`
|
|
130
|
+
- `filter[order.reference]`
|
|
131
|
+
- `filter[region.id]`
|
|
132
|
+
- `filter[shared_capacity_group.id]`
|
|
133
|
+
- `filter[terminated]`
|
|
134
|
+
- `filter[voice_in_trunk.id]`
|
|
135
|
+
- `filter[voice_in_trunk_group.id]`
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## EmergencyCallingService — `GET /v3/emergency_calling_services`
|
|
139
|
+
|
|
140
|
+
- `filter[address.id]`
|
|
141
|
+
- `filter[country.id]`
|
|
142
|
+
- `filter[did_group_type.id]`
|
|
143
|
+
- `filter[identity.id]`
|
|
144
|
+
- `filter[name]`
|
|
145
|
+
- `filter[reference]`
|
|
146
|
+
- `filter[status]`
|
|
147
|
+
|
|
148
|
+
## EmergencyRequirement — `GET /v3/emergency_requirements`
|
|
149
|
+
|
|
150
|
+
- `filter[country.id]`
|
|
151
|
+
- `filter[did_group_type.id]`
|
|
152
|
+
|
|
153
|
+
## EmergencyVerification — `GET /v3/emergency_verifications`
|
|
154
|
+
|
|
155
|
+
- `filter[emergency_calling_service.id]`
|
|
156
|
+
- `filter[external_reference_id]`
|
|
157
|
+
- `filter[status]`
|
|
158
|
+
|
|
159
|
+
## Export — `GET /v3/exports`
|
|
160
|
+
|
|
161
|
+
- `filter[external_reference_id]`
|
|
162
|
+
|
|
163
|
+
## Identity — `GET /v3/identities`
|
|
164
|
+
|
|
165
|
+
- `filter[birth_date]`
|
|
166
|
+
- `filter[company_name]`
|
|
167
|
+
- `filter[company_name_contains]`
|
|
168
|
+
- `filter[company_reg_number]`
|
|
169
|
+
- `filter[company_reg_number_contains]`
|
|
170
|
+
- `filter[country.id]`
|
|
171
|
+
- `filter[description]`
|
|
172
|
+
- `filter[description_contains]`
|
|
173
|
+
- `filter[external_reference_id]`
|
|
174
|
+
- `filter[first_name]`
|
|
175
|
+
- `filter[first_name_contains]`
|
|
176
|
+
- `filter[id_number]`
|
|
177
|
+
- `filter[id_number_contains]`
|
|
178
|
+
- `filter[identity_type]`
|
|
179
|
+
- `filter[last_name]`
|
|
180
|
+
- `filter[last_name_contains]`
|
|
181
|
+
- `filter[personal_tax_id]`
|
|
182
|
+
- `filter[personal_tax_id_contains]`
|
|
183
|
+
- `filter[phone_number]`
|
|
184
|
+
- `filter[phone_number_contains]`
|
|
185
|
+
- `filter[vat_id]`
|
|
186
|
+
- `filter[vat_id_contains]`
|
|
187
|
+
|
|
188
|
+
## NanpaPrefix — `GET /v3/nanpa_prefixes`
|
|
189
|
+
|
|
190
|
+
- `filter[country.id]`
|
|
191
|
+
- `filter[did_group.features]`
|
|
192
|
+
- `filter[did_group.is_available]`
|
|
193
|
+
- `filter[npa]`
|
|
194
|
+
- `filter[npanxx]`
|
|
195
|
+
- `filter[nxx]`
|
|
196
|
+
- `filter[region.id]`
|
|
197
|
+
|
|
198
|
+
## Order — `GET /v3/orders`
|
|
199
|
+
|
|
200
|
+
- `filter[created_at_gteq]`
|
|
201
|
+
- `filter[created_at_lteq]`
|
|
202
|
+
- `filter[external_reference_id]`
|
|
203
|
+
- `filter[reference]`
|
|
204
|
+
- `filter[status]`
|
|
205
|
+
|
|
206
|
+
## PermanentSupportingDocument — `GET /v3/permanent_supporting_documents`
|
|
207
|
+
|
|
208
|
+
- `filter[external_reference_id]`
|
|
209
|
+
|
|
210
|
+
## Proof — `GET /v3/proofs`
|
|
211
|
+
|
|
212
|
+
- `filter[external_reference_id]`
|
|
213
|
+
|
|
214
|
+
## ProofType — `GET /v3/proof_types`
|
|
215
|
+
|
|
216
|
+
- `filter[entity_type]`
|
|
217
|
+
|
|
218
|
+
## Region — `GET /v3/regions`
|
|
219
|
+
|
|
220
|
+
- `filter[country.id]`
|
|
221
|
+
- `filter[iso]`
|
|
222
|
+
- `filter[name]`
|
|
223
|
+
|
|
224
|
+
## SharedCapacityGroup — `GET /v3/shared_capacity_groups`
|
|
225
|
+
|
|
226
|
+
- `filter[capacity_pool.id]`
|
|
227
|
+
- `filter[external_reference_id]`
|
|
228
|
+
- `filter[name]`
|
|
229
|
+
|
|
230
|
+
## SupportingDocumentTemplate — `GET /v3/supporting_document_templates`
|
|
231
|
+
|
|
232
|
+
- `filter[name]`
|
|
233
|
+
- `filter[name_contains]`
|
|
234
|
+
- `filter[permanent]`
|
|
235
|
+
|
|
236
|
+
## VoiceInTrunkGroup — `GET /v3/voice_in_trunk_groups`
|
|
237
|
+
|
|
238
|
+
- `filter[external_reference_id]`
|
|
239
|
+
|
|
240
|
+
## VoiceInTrunk — `GET /v3/voice_in_trunks`
|
|
241
|
+
|
|
242
|
+
- `filter[configuration.type]`
|
|
243
|
+
- `filter[external_reference_id]`
|
|
244
|
+
- `filter[name]`
|
|
245
|
+
|
|
246
|
+
## VoiceOutTrunk — `GET /v3/voice_out_trunks`
|
|
247
|
+
|
|
248
|
+
- `filter[allow_any_did_as_cli]`
|
|
249
|
+
- `filter[authentication_method.type]`
|
|
250
|
+
- `filter[default_did.id]`
|
|
251
|
+
- `filter[default_dst_action]`
|
|
252
|
+
- `filter[external_reference_id]`
|
|
253
|
+
- `filter[media_encryption_mode]`
|
|
254
|
+
- `filter[name]`
|
|
255
|
+
- `filter[name_contains]`
|
|
256
|
+
- `filter[on_cli_mismatch_action]`
|
|
257
|
+
- `filter[status]`
|
|
258
|
+
- `filter[threshold_reached]`
|
data/README.md
CHANGED
|
@@ -361,6 +361,10 @@ recent = DIDWW::Client.did_history
|
|
|
361
361
|
.all
|
|
362
362
|
```
|
|
363
363
|
|
|
364
|
+
## Filter Reference
|
|
365
|
+
|
|
366
|
+
> See [`FILTERS.md`](FILTERS.md) for the canonical list of `filter[KEY]` keys accepted by every list endpoint, verified live against the DIDWW API at version `2026-04-16`.
|
|
367
|
+
|
|
364
368
|
## Error Handling
|
|
365
369
|
|
|
366
370
|
The SDK uses [json_api_client](https://github.com/JsonApiClient/json_api_client) which raises exceptions for HTTP-level errors. Validation errors from the API are returned on the resource's `errors` collection after a failed `save`.
|
data/didww-v3.gemspec
CHANGED
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
spec.email = ['alex.k@didww.com']
|
|
12
12
|
|
|
13
13
|
spec.summary = %q{Ruby client for DIDWW API v3}
|
|
14
|
-
spec.description = %q{Ruby client for DIDWW API v3}
|
|
14
|
+
spec.description = %q{Ruby client for the DIDWW JSON:API v3, covering DID inventory, voice in/out trunks, regulatory documents, exports, and emergency calling services.}
|
|
15
15
|
spec.homepage = 'https://github.com/didww/didww-v3-ruby'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
17
|
|
|
@@ -24,11 +24,16 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
|
|
25
25
|
spec.required_ruby_version = '>= 3.3'
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
spec.add_dependency '
|
|
33
|
-
spec.add_dependency '
|
|
27
|
+
# Lower bounds match the oldest version verified by CI; upper bounds
|
|
28
|
+
# cap on the next known-incompatible major so consumers get a clear
|
|
29
|
+
# constraint failure rather than a runtime surprise. The CI matrix in
|
|
30
|
+
# .github/workflows/tests.yml exercises activesupport ~> 7.2 / 8.0 /
|
|
31
|
+
# 8.1 — declaring a wider lower bound than that would be aspirational.
|
|
32
|
+
spec.add_dependency 'activesupport', '>= 7.2', '< 9'
|
|
33
|
+
spec.add_dependency 'faraday', '~> 2.0'
|
|
34
|
+
spec.add_dependency 'faraday-multipart', '~> 1.0'
|
|
35
|
+
spec.add_dependency 'json_api_client', '~> 1.23'
|
|
36
|
+
spec.add_dependency 'http', '~> 5.0'
|
|
37
|
+
spec.add_dependency 'down', '~> 5.0'
|
|
38
|
+
spec.add_dependency 'openssl-oaep', '~> 0.1'
|
|
34
39
|
end
|
data/examples/README.md
CHANGED
|
@@ -41,6 +41,7 @@ DIDWW_API_KEY=your_api_key ruby examples/orders_nanpa.rb
|
|
|
41
41
|
| Script | Description |
|
|
42
42
|
|---|---|
|
|
43
43
|
| [`voice_in_trunks.rb`](voice_in_trunks.rb) | Lists voice in trunks and their configurations. |
|
|
44
|
+
| [`voice_in_trunk_sip_registration.rb`](voice_in_trunk_sip_registration.rb) | End-to-end SIP registration flow: create with `enabled_sip_registration: true`, rename, disable by setting `host`, re-enable by toggling the flag. The SDK keeps the dependent fields (`host`, `port`, `use_did_in_ruri`) aligned with the server's validation rules automatically. |
|
|
44
45
|
| [`voice_in_trunk_groups.rb`](voice_in_trunk_groups.rb) | CRUD for trunk groups with trunk relationships. |
|
|
45
46
|
|
|
46
47
|
### Voice Out (Outbound)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
#
|
|
3
|
+
# End-to-end SIP registration flow on /voice_in_trunks (API 2026-04-16):
|
|
4
|
+
# create with sip_registration enabled → rename → disable by setting
|
|
5
|
+
# `host` → re-enable by toggling the flag. The SDK keeps the
|
|
6
|
+
# dependent fields (`host`, `port`, `use_did_in_ruri`) aligned with
|
|
7
|
+
# the server's validation rules automatically. The sandbox trunk is
|
|
8
|
+
# left in place after the script completes so it can be inspected
|
|
9
|
+
# afterwards.
|
|
10
|
+
#
|
|
11
|
+
# Usage: DIDWW_API_KEY=your_sandbox_key ruby examples/voice_in_trunk_sip_registration.rb
|
|
12
|
+
|
|
13
|
+
require 'bundler/setup'
|
|
14
|
+
require 'didww'
|
|
15
|
+
|
|
16
|
+
DIDWW::Client.configure do |client|
|
|
17
|
+
client.api_key = ENV.fetch('DIDWW_API_KEY') { abort 'Please set DIDWW_API_KEY' }
|
|
18
|
+
client.api_mode = :sandbox
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
puts "=== Ruby SDK v#{DIDWW::VERSION} — SIP registration flow ==="
|
|
22
|
+
|
|
23
|
+
# 1) Create a SIP trunk with sip_registration enabled. The server
|
|
24
|
+
# generates `incoming_auth_*` credentials and returns them in the
|
|
25
|
+
# response — they are read-only and stripped from any subsequent
|
|
26
|
+
# write payload by the SDK.
|
|
27
|
+
puts "\n[1/4] Create with sip_registration enabled..."
|
|
28
|
+
trunk = DIDWW::Client.voice_in_trunks.new(
|
|
29
|
+
name: "sip-registration-example-#{Time.now.to_i}",
|
|
30
|
+
priority: 1,
|
|
31
|
+
weight: 100,
|
|
32
|
+
cli_format: 'e164',
|
|
33
|
+
ringing_timeout: 30,
|
|
34
|
+
configuration: DIDWW::ComplexObject::SipConfiguration.new.tap do |c|
|
|
35
|
+
c.enabled_sip_registration = true
|
|
36
|
+
c.use_did_in_ruri = true
|
|
37
|
+
c.cnam_lookup = false
|
|
38
|
+
c.codec_ids = [9, 7]
|
|
39
|
+
c.transport_protocol_id = 1
|
|
40
|
+
end
|
|
41
|
+
)
|
|
42
|
+
abort "create failed: #{trunk.errors.full_messages.join('; ')}" unless trunk.save
|
|
43
|
+
puts " id=#{trunk.id}"
|
|
44
|
+
puts " incoming_auth_username=#{trunk.configuration.incoming_auth_username.inspect}"
|
|
45
|
+
puts " incoming_auth_password=#{trunk.configuration.incoming_auth_password.inspect}"
|
|
46
|
+
trunk_id = trunk.id
|
|
47
|
+
|
|
48
|
+
# 2) Rename — a single-field PATCH that doesn't touch SIP-registration state.
|
|
49
|
+
puts "\n[2/4] Rename trunk..."
|
|
50
|
+
trunk.name = "sip-registration-renamed-#{Time.now.to_i}"
|
|
51
|
+
abort "rename failed: #{trunk.errors.full_messages.join('; ')}" unless trunk.save
|
|
52
|
+
puts " name=#{trunk.name}"
|
|
53
|
+
|
|
54
|
+
# 3) Disable sip_registration by setting `host`. The SDK flips
|
|
55
|
+
# `enabled_sip_registration` and `use_did_in_ruri` to false in the
|
|
56
|
+
# same PATCH so the server-side validators accept the change.
|
|
57
|
+
puts "\n[3/4] Disable by setting host..."
|
|
58
|
+
trunk.configuration = DIDWW::ComplexObject::SipConfiguration.new.tap do |c|
|
|
59
|
+
c.host = '203.0.113.10'
|
|
60
|
+
end
|
|
61
|
+
abort "disable failed: #{trunk.errors.full_messages.join('; ')}" unless trunk.save
|
|
62
|
+
fresh = DIDWW::Client.voice_in_trunks.find(trunk_id).first
|
|
63
|
+
puts " enabled_sip_registration=#{fresh.configuration.enabled_sip_registration.inspect}"
|
|
64
|
+
puts " use_did_in_ruri=#{fresh.configuration.use_did_in_ruri.inspect}"
|
|
65
|
+
puts " host=#{fresh.configuration.host.inspect}"
|
|
66
|
+
puts " incoming_auth_username=#{fresh.configuration.incoming_auth_username.inspect}"
|
|
67
|
+
|
|
68
|
+
# 4) Re-enable sip_registration. Setting `enabled_sip_registration = true`
|
|
69
|
+
# sends host=nil / port=nil on the wire so the server (which still has
|
|
70
|
+
# the host from step 3) is told to clear them.
|
|
71
|
+
puts "\n[4/4] Re-enable by toggling enabled_sip_registration..."
|
|
72
|
+
trunk = DIDWW::Client.voice_in_trunks.find(trunk_id).first
|
|
73
|
+
trunk.configuration = DIDWW::ComplexObject::SipConfiguration.new.tap do |c|
|
|
74
|
+
c.enabled_sip_registration = true
|
|
75
|
+
c.use_did_in_ruri = true
|
|
76
|
+
end
|
|
77
|
+
abort "re-enable failed: #{trunk.errors.full_messages.join('; ')}" unless trunk.save
|
|
78
|
+
fresh = DIDWW::Client.voice_in_trunks.find(trunk_id).first
|
|
79
|
+
puts " enabled_sip_registration=#{fresh.configuration.enabled_sip_registration.inspect}"
|
|
80
|
+
puts " host=#{fresh.configuration.host.inspect}"
|
|
81
|
+
puts " incoming_auth_username=#{fresh.configuration.incoming_auth_username.inspect}"
|
|
82
|
+
|
|
83
|
+
puts "\n=== PASS — trunk #{trunk_id} left in sandbox ==="
|
|
@@ -350,12 +350,14 @@ module DIDWW
|
|
|
350
350
|
def enabled_sip_registration=(val)
|
|
351
351
|
case val
|
|
352
352
|
when true
|
|
353
|
-
#
|
|
354
|
-
#
|
|
355
|
-
#
|
|
356
|
-
#
|
|
357
|
-
|
|
358
|
-
|
|
353
|
+
# Always emit host: null and port: null on the wire when
|
|
354
|
+
# enabling sip_registration. The server requires both blank
|
|
355
|
+
# (returns 422 otherwise) AND a PATCH against an existing
|
|
356
|
+
# trunk that already has host/port set on the server side
|
|
357
|
+
# MUST explicitly nullify them — the SDK's local attributes
|
|
358
|
+
# hash starts empty, so there's nothing to "preserve".
|
|
359
|
+
self[:host] = nil
|
|
360
|
+
self[:port] = nil
|
|
359
361
|
when false
|
|
360
362
|
# Server requires use_did_in_ruri = false whenever sip_registration
|
|
361
363
|
# is disabled. Always emit it on the wire so the server's check
|
|
@@ -15,7 +15,7 @@ module DIDWW
|
|
|
15
15
|
property :monthly_price, type: :decimal
|
|
16
16
|
property :nrc, type: :decimal
|
|
17
17
|
property :mrc, type: :decimal
|
|
18
|
-
property :
|
|
18
|
+
property :prorated_mrc, type: :boolean
|
|
19
19
|
property :billed_from, type: :string
|
|
20
20
|
property :billed_to, type: :string
|
|
21
21
|
property :did_group_id, type: :string
|
|
@@ -12,6 +12,10 @@ module DIDWW
|
|
|
12
12
|
# Type: DateTime
|
|
13
13
|
# Description: DID reservation created at DateTime.
|
|
14
14
|
|
|
15
|
+
property :description, type: :string
|
|
16
|
+
# Type: String
|
|
17
|
+
# Description: Customer-supplied note attached to the reservation.
|
|
18
|
+
# Writable on POST; returned on subsequent GETs.
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
end
|
data/lib/didww/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: didww-v3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Korobeinikov
|
|
@@ -15,99 +15,106 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '7.2'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '9'
|
|
19
22
|
type: :runtime
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
23
26
|
- - ">="
|
|
24
27
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
28
|
+
version: '7.2'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '9'
|
|
26
32
|
- !ruby/object:Gem::Dependency
|
|
27
33
|
name: faraday
|
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
|
29
35
|
requirements:
|
|
30
|
-
- - "
|
|
36
|
+
- - "~>"
|
|
31
37
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0'
|
|
38
|
+
version: '2.0'
|
|
33
39
|
type: :runtime
|
|
34
40
|
prerelease: false
|
|
35
41
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
42
|
requirements:
|
|
37
|
-
- - "
|
|
43
|
+
- - "~>"
|
|
38
44
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0'
|
|
45
|
+
version: '2.0'
|
|
40
46
|
- !ruby/object:Gem::Dependency
|
|
41
47
|
name: faraday-multipart
|
|
42
48
|
requirement: !ruby/object:Gem::Requirement
|
|
43
49
|
requirements:
|
|
44
|
-
- - "
|
|
50
|
+
- - "~>"
|
|
45
51
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '0'
|
|
52
|
+
version: '1.0'
|
|
47
53
|
type: :runtime
|
|
48
54
|
prerelease: false
|
|
49
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
56
|
requirements:
|
|
51
|
-
- - "
|
|
57
|
+
- - "~>"
|
|
52
58
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '0'
|
|
59
|
+
version: '1.0'
|
|
54
60
|
- !ruby/object:Gem::Dependency
|
|
55
61
|
name: json_api_client
|
|
56
62
|
requirement: !ruby/object:Gem::Requirement
|
|
57
63
|
requirements:
|
|
58
|
-
- -
|
|
64
|
+
- - "~>"
|
|
59
65
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 1.23
|
|
66
|
+
version: '1.23'
|
|
61
67
|
type: :runtime
|
|
62
68
|
prerelease: false
|
|
63
69
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
70
|
requirements:
|
|
65
|
-
- -
|
|
71
|
+
- - "~>"
|
|
66
72
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 1.23
|
|
73
|
+
version: '1.23'
|
|
68
74
|
- !ruby/object:Gem::Dependency
|
|
69
75
|
name: http
|
|
70
76
|
requirement: !ruby/object:Gem::Requirement
|
|
71
77
|
requirements:
|
|
72
|
-
- - "
|
|
78
|
+
- - "~>"
|
|
73
79
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '0'
|
|
80
|
+
version: '5.0'
|
|
75
81
|
type: :runtime
|
|
76
82
|
prerelease: false
|
|
77
83
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
84
|
requirements:
|
|
79
|
-
- - "
|
|
85
|
+
- - "~>"
|
|
80
86
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '0'
|
|
87
|
+
version: '5.0'
|
|
82
88
|
- !ruby/object:Gem::Dependency
|
|
83
89
|
name: down
|
|
84
90
|
requirement: !ruby/object:Gem::Requirement
|
|
85
91
|
requirements:
|
|
86
|
-
- - "
|
|
92
|
+
- - "~>"
|
|
87
93
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '0'
|
|
94
|
+
version: '5.0'
|
|
89
95
|
type: :runtime
|
|
90
96
|
prerelease: false
|
|
91
97
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
98
|
requirements:
|
|
93
|
-
- - "
|
|
99
|
+
- - "~>"
|
|
94
100
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '0'
|
|
101
|
+
version: '5.0'
|
|
96
102
|
- !ruby/object:Gem::Dependency
|
|
97
103
|
name: openssl-oaep
|
|
98
104
|
requirement: !ruby/object:Gem::Requirement
|
|
99
105
|
requirements:
|
|
100
|
-
- - "
|
|
106
|
+
- - "~>"
|
|
101
107
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '0'
|
|
108
|
+
version: '0.1'
|
|
103
109
|
type: :runtime
|
|
104
110
|
prerelease: false
|
|
105
111
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
112
|
requirements:
|
|
107
|
-
- - "
|
|
113
|
+
- - "~>"
|
|
108
114
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '0'
|
|
110
|
-
description: Ruby client for DIDWW API v3
|
|
115
|
+
version: '0.1'
|
|
116
|
+
description: Ruby client for the DIDWW JSON:API v3, covering DID inventory, voice
|
|
117
|
+
in/out trunks, regulatory documents, exports, and emergency calling services.
|
|
111
118
|
email:
|
|
112
119
|
- alex.k@didww.com
|
|
113
120
|
executables: []
|
|
@@ -121,6 +128,7 @@ files:
|
|
|
121
128
|
- ".rspec"
|
|
122
129
|
- ".rubocop.yml"
|
|
123
130
|
- CHANGELOG.md
|
|
131
|
+
- FILTERS.md
|
|
124
132
|
- Gemfile
|
|
125
133
|
- LICENSE.txt
|
|
126
134
|
- README.md
|
|
@@ -158,6 +166,7 @@ files:
|
|
|
158
166
|
- examples/regions.rb
|
|
159
167
|
- examples/shared_capacity_groups.rb
|
|
160
168
|
- examples/voice_in_trunk_groups.rb
|
|
169
|
+
- examples/voice_in_trunk_sip_registration.rb
|
|
161
170
|
- examples/voice_in_trunks.rb
|
|
162
171
|
- examples/voice_out_trunks.rb
|
|
163
172
|
- lib/didww.rb
|