didww-v3 6.2.0 → 7.0.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 +8 -6
- data/.rubocop.yml +0 -110
- data/CHANGELOG.md +65 -0
- data/FILTERS.md +36 -12
- data/Gemfile +0 -2
- data/README.md +431 -58
- data/didww-v3.gemspec +11 -8
- data/docs/resource_relationships.md +35 -15
- data/examples/README.md +54 -61
- data/examples/capacity_pools.rb +28 -10
- data/examples/countries.rb +1 -1
- data/examples/did_groups.rb +1 -1
- data/examples/did_reservations.rb +35 -37
- data/examples/did_sms_routing.rb +91 -0
- data/examples/did_trunk_assignment.rb +106 -80
- data/examples/emergency_calling_services.rb +3 -3
- data/examples/emergency_requirements.rb +3 -3
- data/examples/emergency_scenario.rb +11 -11
- data/examples/emergency_verifications.rb +7 -5
- data/examples/exports.rb +1 -1
- data/examples/exports_sms.rb +72 -0
- data/examples/identity_address_proofs.rb +118 -0
- data/examples/includes.rb +65 -0
- data/examples/orders.rb +8 -6
- data/examples/orders_all_item_types.rb +63 -125
- data/examples/orders_emergency.rb +3 -3
- data/examples/{orders_by_sku.rb → orders_sku.rb} +12 -10
- data/examples/prices_download.rb +45 -0
- data/examples/prices_lookup.rb +43 -0
- data/examples/regions.rb +1 -1
- data/examples/sample.pdf +14 -0
- data/examples/sender_id_verifications.rb +63 -0
- data/examples/shared_capacity_groups.rb +44 -35
- data/examples/sms_trunk_groups.rb +71 -0
- data/examples/sms_trunks.rb +84 -0
- data/examples/test_readme.rb +1216 -0
- data/examples/trunks.rb +115 -0
- data/examples/upload_file.rb +44 -0
- data/examples/voice_in_trunk_groups.rb +57 -33
- data/examples/voice_in_trunk_sip_registration.rb +4 -1
- data/examples/voice_out_trunks.rb +11 -1
- data/examples/webhook.rb +51 -0
- data/lib/didww/auth/bearer_middleware.rb +74 -0
- data/lib/didww/auth/memory_store.rb +40 -0
- data/lib/didww/auth/token.rb +45 -0
- data/lib/didww/auth/token_provider.rb +215 -0
- data/lib/didww/base_middleware.rb +7 -8
- data/lib/didww/callback/request_validator.rb +7 -5
- data/lib/didww/client.rb +122 -13
- data/lib/didww/complex_objects/authentication_methods/generic.rb +6 -0
- data/lib/didww/complex_objects/configurations/base.rb +0 -18
- data/lib/didww/complex_objects/configurations/pstn_configuration.rb +0 -4
- data/lib/didww/complex_objects/configurations/sip_configuration.rb +86 -38
- data/lib/didww/complex_objects/emergency_order_item.rb +1 -1
- data/lib/didww/complex_objects/export_filters.rb +72 -6
- data/lib/didww/complex_objects/generic_order_item.rb +15 -0
- data/lib/didww/complex_objects/sms_trunk_configuration.rb +33 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/base.rb +26 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/generic.rb +32 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/http_in.rb +75 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/http_out.rb +35 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/smpp_esme.rb +37 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/smpp_smsc.rb +56 -0
- data/lib/didww/complex_objects/sms_trunk_configurations/sms_to_email.rb +27 -0
- data/lib/didww/errors.rb +103 -0
- data/lib/didww/http.rb +34 -0
- data/lib/didww/prices/lookup_result.rb +37 -0
- data/lib/didww/prices/price.rb +56 -0
- data/lib/didww/prices/price_file.rb +51 -0
- data/lib/didww/prices/service.rb +248 -0
- data/lib/didww/prices/sms_in_price.rb +43 -0
- data/lib/didww/prices/sms_out_price.rb +52 -0
- data/lib/didww/prices/voice_in_price.rb +48 -0
- data/lib/didww/prices/voice_out_price.rb +88 -0
- data/lib/didww/prices.rb +82 -0
- data/lib/didww/resource/address_requirement.rb +13 -3
- data/lib/didww/resource/base.rb +5 -2
- data/lib/didww/resource/concerns/number_types.rb +24 -0
- data/lib/didww/resource/did.rb +42 -3
- data/lib/didww/resource/did_group.rb +12 -1
- data/lib/didww/resource/emergency_calling_service.rb +10 -5
- data/lib/didww/resource/emergency_requirement.rb +27 -14
- data/lib/didww/resource/encrypted_file.rb +19 -6
- data/lib/didww/resource/export.rb +59 -12
- data/lib/didww/resource/identity.rb +9 -4
- data/lib/didww/resource/order.rb +1 -0
- data/lib/didww/resource/proof_type.rb +1 -1
- data/lib/didww/resource/sender_id_verification.rb +114 -0
- data/lib/didww/resource/sms_trunk.rb +76 -0
- data/lib/didww/resource/sms_trunk_group.rb +31 -0
- data/lib/didww/resource/sms_trunk_regenerate_credential.rb +16 -0
- data/lib/didww/resource/voice_in_trunk.rb +24 -1
- data/lib/didww/resource/voice_out_trunk.rb +72 -0
- data/lib/didww/types/ip_addresses.rb +1 -1
- data/lib/didww/types/strings.rb +1 -1
- data/lib/didww/types.rb +3 -1
- data/lib/didww/version.rb +1 -1
- data/lib/didww.rb +7 -0
- metadata +63 -25
- data/examples/identities_and_proofs.rb +0 -67
- data/examples/voice_in_trunks.rb +0 -108
- data/lib/didww/resource/did_group_type.rb +0 -10
- data/lib/didww/resource/exclusive_relationship.rb +0 -54
- data/lib/didww/resource/pop.rb +0 -10
|
@@ -28,9 +28,9 @@ module DIDWW
|
|
|
28
28
|
# Type: String
|
|
29
29
|
# Description:
|
|
30
30
|
|
|
31
|
-
property :birth_date, type: :
|
|
32
|
-
# Type:
|
|
33
|
-
# Description:
|
|
31
|
+
property :birth_date, type: :string
|
|
32
|
+
# Type: String
|
|
33
|
+
# Description: Date of birth, "YYYY-MM-DD"
|
|
34
34
|
|
|
35
35
|
property :company_name, type: :string
|
|
36
36
|
# Type: String
|
|
@@ -42,7 +42,8 @@ module DIDWW
|
|
|
42
42
|
|
|
43
43
|
property :vat_id, type: :string
|
|
44
44
|
# Type: String
|
|
45
|
-
# Description:
|
|
45
|
+
# Description: VAT identification number, listed as tax_id in the mandatory fields of
|
|
46
|
+
# AddressRequirement and EmergencyRequirement.
|
|
46
47
|
|
|
47
48
|
property :description, type: :string
|
|
48
49
|
# Type: String
|
|
@@ -72,6 +73,10 @@ module DIDWW
|
|
|
72
73
|
# Type: String
|
|
73
74
|
# Description:
|
|
74
75
|
|
|
76
|
+
property :company_website, type: :string
|
|
77
|
+
# Type: String
|
|
78
|
+
# Description: Company website. Rejected on a personal identity.
|
|
79
|
+
|
|
75
80
|
def personal?
|
|
76
81
|
identity_type == IDENTITY_TYPE_PERSONAL
|
|
77
82
|
end
|
data/lib/didww/resource/order.rb
CHANGED
|
@@ -3,6 +3,7 @@ require 'didww/complex_objects/did_order_item'
|
|
|
3
3
|
require 'didww/resource/concerns/has_status_helpers'
|
|
4
4
|
require 'didww/complex_objects/capacity_order_item'
|
|
5
5
|
require 'didww/complex_objects/emergency_order_item'
|
|
6
|
+
require 'didww/complex_objects/generic_order_item'
|
|
6
7
|
require 'didww/callback/const'
|
|
7
8
|
|
|
8
9
|
module DIDWW
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'didww/resource/concerns/has_status_helpers'
|
|
4
|
+
|
|
5
|
+
module DIDWW
|
|
6
|
+
module Resource
|
|
7
|
+
# Verification of a sender identity used for outbound messages.
|
|
8
|
+
# Supported operations: index, show, update. Only name and sms_trunk can be changed,
|
|
9
|
+
# and a closed verification cannot be updated.
|
|
10
|
+
#
|
|
11
|
+
# Server-side filters: status, sender_type, sms_trunk.id, name, reference.
|
|
12
|
+
#
|
|
13
|
+
# meta carries: setup_price, monthly_price.
|
|
14
|
+
class SenderIdVerification < Base
|
|
15
|
+
include HasStatusHelpers
|
|
16
|
+
|
|
17
|
+
STATUS_ACTIVE = 'active'
|
|
18
|
+
STATUS_CHANGES_REQUIRED = 'changes_required'
|
|
19
|
+
STATUS_CLOSED = 'closed'
|
|
20
|
+
STATUS_CLOSING_IN_PROCESS = 'closing_in_process'
|
|
21
|
+
STATUS_IN_PROCESS = 'in_process'
|
|
22
|
+
STATUS_NEW = 'new'
|
|
23
|
+
|
|
24
|
+
STATUSES = [
|
|
25
|
+
STATUS_ACTIVE,
|
|
26
|
+
STATUS_CHANGES_REQUIRED,
|
|
27
|
+
STATUS_CLOSED,
|
|
28
|
+
STATUS_CLOSING_IN_PROCESS,
|
|
29
|
+
STATUS_IN_PROCESS,
|
|
30
|
+
STATUS_NEW
|
|
31
|
+
].freeze
|
|
32
|
+
|
|
33
|
+
SENDER_TYPE_ALPHANUMERIC = 'alphanumeric'
|
|
34
|
+
SENDER_TYPE_CARRIER = 'carrier'
|
|
35
|
+
SENDER_TYPE_LONG_CODE = 'long_code'
|
|
36
|
+
SENDER_TYPE_SHORT_CODE = 'short_code'
|
|
37
|
+
SENDER_TYPE_TOLL_FREE = 'toll_free'
|
|
38
|
+
|
|
39
|
+
SENDER_TYPES = [
|
|
40
|
+
SENDER_TYPE_ALPHANUMERIC,
|
|
41
|
+
SENDER_TYPE_CARRIER,
|
|
42
|
+
SENDER_TYPE_LONG_CODE,
|
|
43
|
+
SENDER_TYPE_SHORT_CODE,
|
|
44
|
+
SENDER_TYPE_TOLL_FREE
|
|
45
|
+
].freeze
|
|
46
|
+
|
|
47
|
+
has_one :sms_trunk, class_name: 'SmsTrunk'
|
|
48
|
+
has_many :countries, class_name: 'Country'
|
|
49
|
+
has_many :dids, class_name: 'Did'
|
|
50
|
+
has_one :order, class_name: 'Order'
|
|
51
|
+
has_one :identity, class_name: 'Identity'
|
|
52
|
+
has_one :address, class_name: 'Address'
|
|
53
|
+
|
|
54
|
+
property :name, type: :string
|
|
55
|
+
# Type: String
|
|
56
|
+
# Description: Name of the verification
|
|
57
|
+
|
|
58
|
+
property :status, type: :string
|
|
59
|
+
# Type: String
|
|
60
|
+
# Description: One of STATUSES. Read-only.
|
|
61
|
+
|
|
62
|
+
property :sender_type, type: :string
|
|
63
|
+
# Type: String
|
|
64
|
+
# Description: One of SENDER_TYPES. Read-only.
|
|
65
|
+
|
|
66
|
+
property :sender_ids, type: :array
|
|
67
|
+
# Type: Array<String>
|
|
68
|
+
# Description: Sender IDs the verification covers; for long_code and toll_free, the numbers
|
|
69
|
+
# of the DIDs. Read-only.
|
|
70
|
+
|
|
71
|
+
property :reference, type: :string
|
|
72
|
+
# Type: String
|
|
73
|
+
# Description: Human-readable reference. Read-only.
|
|
74
|
+
|
|
75
|
+
property :reject_reasons, type: :array
|
|
76
|
+
# Type: Array<String>
|
|
77
|
+
# Nullable: Yes
|
|
78
|
+
# Description: Reasons the last submission was rejected; nil unless changes_required, and when
|
|
79
|
+
# there are none. Read-only.
|
|
80
|
+
|
|
81
|
+
property :reject_comment, type: :string
|
|
82
|
+
# Type: String
|
|
83
|
+
# Nullable: Yes
|
|
84
|
+
# Description: Reviewer comment on the rejection; nil unless changes_required. Read-only.
|
|
85
|
+
|
|
86
|
+
property :renew_date, type: :string
|
|
87
|
+
# Type: String
|
|
88
|
+
# Nullable: Yes
|
|
89
|
+
# Description: Next renewal date, "YYYY-MM-DD"; nil once closed. Read-only.
|
|
90
|
+
|
|
91
|
+
property :created_at, type: :time
|
|
92
|
+
# Type: Time
|
|
93
|
+
# Description: Read-only.
|
|
94
|
+
|
|
95
|
+
property :activated_at, type: :time
|
|
96
|
+
# Type: Time
|
|
97
|
+
# Nullable: Yes
|
|
98
|
+
# Description: Read-only.
|
|
99
|
+
|
|
100
|
+
property :closed_at, type: :time
|
|
101
|
+
# Type: Time
|
|
102
|
+
# Nullable: Yes
|
|
103
|
+
# Description: Read-only.
|
|
104
|
+
|
|
105
|
+
status_helper :active, STATUS_ACTIVE
|
|
106
|
+
status_helper :changes_required, STATUS_CHANGES_REQUIRED
|
|
107
|
+
status_helper :closed, STATUS_CLOSED
|
|
108
|
+
status_helper :closing_in_process, STATUS_CLOSING_IN_PROCESS
|
|
109
|
+
status_helper :in_process, STATUS_IN_PROCESS
|
|
110
|
+
# "new" collides with Class.new, so expose the predicate as new_status?
|
|
111
|
+
status_helper :new_status, STATUS_NEW
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require 'didww/complex_objects/sms_trunk_configuration'
|
|
3
|
+
|
|
4
|
+
module DIDWW
|
|
5
|
+
module Resource
|
|
6
|
+
# meta carries: host, the URL to submit outbound messages to (http_out trunks only).
|
|
7
|
+
class SmsTrunk < Base
|
|
8
|
+
has_many :outgoing_dids, class_name: 'Did'
|
|
9
|
+
has_many :incoming_dids, class_name: 'Did'
|
|
10
|
+
has_one :sms_trunk_group, class_name: 'SmsTrunkGroup'
|
|
11
|
+
has_many :sender_id_verifications, class_name: 'SenderIdVerification'
|
|
12
|
+
|
|
13
|
+
property :name, type: :string
|
|
14
|
+
# Type: String
|
|
15
|
+
# Description: Friendly name of the trunk. Required when the trunk is created.
|
|
16
|
+
|
|
17
|
+
property :external_reference_id, type: :string
|
|
18
|
+
# Type: String
|
|
19
|
+
# Nullable: Yes
|
|
20
|
+
# Description: Customer-supplied reference. Max 100 characters.
|
|
21
|
+
|
|
22
|
+
property :blocked, type: :boolean
|
|
23
|
+
# Type: Boolean
|
|
24
|
+
# Description: Set to true to stop the trunk from handling messages
|
|
25
|
+
|
|
26
|
+
property :priority, type: :integer
|
|
27
|
+
# Type: Integer
|
|
28
|
+
# Nullable: Yes
|
|
29
|
+
# Description: Routing priority within an SMS trunk group, 0-32767; the higher value is tried first.
|
|
30
|
+
# Defaults to 100, and must stay null on http_out trunks, which cannot join a group.
|
|
31
|
+
|
|
32
|
+
property :allow_any_did_as_source, type: :boolean
|
|
33
|
+
# Type: Boolean
|
|
34
|
+
# Description: Allow any DID the customer owns as the message source. Turning it on empties
|
|
35
|
+
# outgoing_dids. Refused on the trunk types that only receive messages.
|
|
36
|
+
|
|
37
|
+
property :allow_in, type: :boolean
|
|
38
|
+
# Type: Boolean
|
|
39
|
+
# Description: True when the trunk handles inbound messages. Read-only.
|
|
40
|
+
|
|
41
|
+
property :allow_out, type: :boolean
|
|
42
|
+
# Type: Boolean
|
|
43
|
+
# Description: True when the trunk can send messages. Read-only.
|
|
44
|
+
|
|
45
|
+
property :created_at, type: :time
|
|
46
|
+
# Type: DateTime
|
|
47
|
+
# Description: Trunk created at DateTime. Read-only.
|
|
48
|
+
|
|
49
|
+
property :updated_at, type: :time
|
|
50
|
+
# Type: DateTime
|
|
51
|
+
# Description: Trunk updated at DateTime. Read-only.
|
|
52
|
+
|
|
53
|
+
property :configuration, type: :sms_trunk_configuration
|
|
54
|
+
# Type: one of ComplexObject::SmsTrunkConfiguration::TYPES
|
|
55
|
+
# sms_to_email, http_in, http_out, smpp_esme, smpp_smsc
|
|
56
|
+
# Description: Delivery configuration. Required when the trunk is created. On update the
|
|
57
|
+
# type must match the stored one; attributes left out keep their values.
|
|
58
|
+
|
|
59
|
+
def initialize(*args)
|
|
60
|
+
super
|
|
61
|
+
attribute_will_change!(:configuration) if configuration
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# The server sends meta on http_out trunks only.
|
|
65
|
+
def host
|
|
66
|
+
attributes[:meta]&.[](:host)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def regenerate_credentials
|
|
70
|
+
resource = DIDWW::Resource::SmsTrunkRegenerateCredential.new
|
|
71
|
+
resource.relationships[:sms_trunk] = self
|
|
72
|
+
resource.save
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
module DIDWW
|
|
3
|
+
module Resource
|
|
4
|
+
# Deleting a group also deletes the trunks in it.
|
|
5
|
+
class SmsTrunkGroup < Base
|
|
6
|
+
has_many :sms_trunks, class_name: 'SmsTrunk'
|
|
7
|
+
has_many :incoming_dids, class_name: 'Did'
|
|
8
|
+
|
|
9
|
+
property :name, type: :string
|
|
10
|
+
# Type: String
|
|
11
|
+
# Description: Friendly name of the group. Required when the group is created.
|
|
12
|
+
|
|
13
|
+
property :external_reference_id, type: :string
|
|
14
|
+
# Type: String
|
|
15
|
+
# Nullable: Yes
|
|
16
|
+
# Description: Customer-supplied reference. Max 100 characters.
|
|
17
|
+
|
|
18
|
+
property :created_at, type: :time
|
|
19
|
+
# Type: DateTime
|
|
20
|
+
# Description: Group created at DateTime. Read-only.
|
|
21
|
+
|
|
22
|
+
property :updated_at, type: :time
|
|
23
|
+
# Type: DateTime
|
|
24
|
+
# Description: Group updated at DateTime. Read-only.
|
|
25
|
+
|
|
26
|
+
def sms_trunks_count
|
|
27
|
+
attributes[:meta]&.[](:sms_trunks_count)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module DIDWW
|
|
4
|
+
module Resource
|
|
5
|
+
# Rotates the generated credentials of an smpp_esme or http_out trunk.
|
|
6
|
+
# The new credentials are read back from the trunk.
|
|
7
|
+
class SmsTrunkRegenerateCredential < Base
|
|
8
|
+
has_one :sms_trunk
|
|
9
|
+
|
|
10
|
+
# The request declares no attributes; json_api_client would send "attributes": {}.
|
|
11
|
+
def as_json_api(*)
|
|
12
|
+
super.tap { |h| h.delete(:attributes) if h[:attributes].blank? }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -29,7 +29,25 @@ module DIDWW
|
|
|
29
29
|
CONF_TYPE_PSTN => DIDWW::ComplexObject::PstnConfiguration
|
|
30
30
|
}.freeze
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
# Allowed values for trunk.pop
|
|
33
|
+
POP_NYC = 'nyc'
|
|
34
|
+
POP_FRA = 'fra'
|
|
35
|
+
POP_LAC = 'lac'
|
|
36
|
+
POP_MIA = 'mia'
|
|
37
|
+
POP_SG = 'sg'
|
|
38
|
+
POP_HK = 'hk'
|
|
39
|
+
POP_AMS = 'ams'
|
|
40
|
+
|
|
41
|
+
POPS = [
|
|
42
|
+
POP_NYC,
|
|
43
|
+
POP_FRA,
|
|
44
|
+
POP_LAC,
|
|
45
|
+
POP_MIA,
|
|
46
|
+
POP_SG,
|
|
47
|
+
POP_HK,
|
|
48
|
+
POP_AMS
|
|
49
|
+
].freeze
|
|
50
|
+
|
|
33
51
|
has_one :voice_in_trunk_group
|
|
34
52
|
|
|
35
53
|
property :priority, type: :integer
|
|
@@ -82,6 +100,11 @@ module DIDWW
|
|
|
82
100
|
# Type: String
|
|
83
101
|
# Description: Customer-supplied reference. Max 100 characters. (API 2026-04-16)
|
|
84
102
|
|
|
103
|
+
property :pop, type: :string
|
|
104
|
+
# Type: String
|
|
105
|
+
# Description: Point of presence the trunk is pinned to, one of POPS. Null lets DIDWW choose.
|
|
106
|
+
# Replaces the pop relationship.
|
|
107
|
+
|
|
85
108
|
def initialize(*args)
|
|
86
109
|
super
|
|
87
110
|
attribute_will_change!(:configuration) if configuration
|
|
@@ -51,6 +51,60 @@ module DIDWW
|
|
|
51
51
|
MEDIA_ENCRYPTION_MODE_ZRTP
|
|
52
52
|
].freeze
|
|
53
53
|
|
|
54
|
+
CODEC_TELEPHONE_EVENT = 'telephone_event'
|
|
55
|
+
CODEC_G723 = 'g723'
|
|
56
|
+
CODEC_G729 = 'g729'
|
|
57
|
+
CODEC_PCMU = 'pcmu'
|
|
58
|
+
CODEC_PCMA = 'pcma'
|
|
59
|
+
CODEC_GSM = 'gsm'
|
|
60
|
+
CODEC_G722 = 'g722'
|
|
61
|
+
CODEC_OPUS = 'opus'
|
|
62
|
+
CODEC_AMR = 'amr'
|
|
63
|
+
CODEC_AMR_WB = 'amr_wb'
|
|
64
|
+
|
|
65
|
+
CODECS = [
|
|
66
|
+
CODEC_TELEPHONE_EVENT,
|
|
67
|
+
CODEC_G723,
|
|
68
|
+
CODEC_G729,
|
|
69
|
+
CODEC_PCMU,
|
|
70
|
+
CODEC_PCMA,
|
|
71
|
+
CODEC_GSM,
|
|
72
|
+
CODEC_G722,
|
|
73
|
+
CODEC_OPUS,
|
|
74
|
+
CODEC_AMR,
|
|
75
|
+
CODEC_AMR_WB
|
|
76
|
+
].freeze
|
|
77
|
+
|
|
78
|
+
ICE_MODE_DISABLED = 'disabled'
|
|
79
|
+
ICE_MODE_ACCEPT = 'accept'
|
|
80
|
+
ICE_MODE_INITIATE = 'initiate'
|
|
81
|
+
|
|
82
|
+
ICE_MODES = [
|
|
83
|
+
ICE_MODE_DISABLED,
|
|
84
|
+
ICE_MODE_ACCEPT,
|
|
85
|
+
ICE_MODE_INITIATE
|
|
86
|
+
].freeze
|
|
87
|
+
|
|
88
|
+
RTCP_MUX_MODE_DISABLED = 'disabled'
|
|
89
|
+
RTCP_MUX_MODE_ACCEPT = 'accept'
|
|
90
|
+
RTCP_MUX_MODE_INITIATE = 'initiate'
|
|
91
|
+
|
|
92
|
+
RTCP_MUX_MODES = [
|
|
93
|
+
RTCP_MUX_MODE_DISABLED,
|
|
94
|
+
RTCP_MUX_MODE_ACCEPT,
|
|
95
|
+
RTCP_MUX_MODE_INITIATE
|
|
96
|
+
].freeze
|
|
97
|
+
|
|
98
|
+
RTCP_FEEDBACK_MODE_DISABLED = 'disabled'
|
|
99
|
+
RTCP_FEEDBACK_MODE_ACCEPT = 'accept'
|
|
100
|
+
RTCP_FEEDBACK_MODE_INITIATE = 'initiate'
|
|
101
|
+
|
|
102
|
+
RTCP_FEEDBACK_MODES = [
|
|
103
|
+
RTCP_FEEDBACK_MODE_DISABLED,
|
|
104
|
+
RTCP_FEEDBACK_MODE_ACCEPT,
|
|
105
|
+
RTCP_FEEDBACK_MODE_INITIATE
|
|
106
|
+
].freeze
|
|
107
|
+
|
|
54
108
|
property :name, type: :string
|
|
55
109
|
property :on_cli_mismatch_action, type: :string
|
|
56
110
|
property :capacity_limit, type: :integer
|
|
@@ -81,6 +135,24 @@ module DIDWW
|
|
|
81
135
|
# (API 2026-04-16)
|
|
82
136
|
property :rtp_timeout, type: :integer
|
|
83
137
|
|
|
138
|
+
# Type: Array of strings
|
|
139
|
+
# Description: Codecs offered on calls from the trunk, in priority order: the first has the
|
|
140
|
+
# highest priority. One or more of CODECS. Defaults to pcma, pcmu, telephone_event.
|
|
141
|
+
property :codecs, type: :strings
|
|
142
|
+
|
|
143
|
+
# Type: String
|
|
144
|
+
# Description: ICE (Interactive Connectivity Establishment) for calls from the trunk,
|
|
145
|
+
# one of ICE_MODES. Defaults to accept.
|
|
146
|
+
property :ice_mode, type: :string
|
|
147
|
+
|
|
148
|
+
# Type: String
|
|
149
|
+
# Description: RTP and RTCP multiplexed on one port, one of RTCP_MUX_MODES. Defaults to accept.
|
|
150
|
+
property :rtcp_mux_mode, type: :string
|
|
151
|
+
|
|
152
|
+
# Type: String
|
|
153
|
+
# Description: RTCP feedback (AVPF), one of RTCP_FEEDBACK_MODES. Defaults to accept.
|
|
154
|
+
property :rtcp_feedback_mode, type: :string
|
|
155
|
+
|
|
84
156
|
# Polymorphic authentication_method (2026-04-16). One of:
|
|
85
157
|
# - ip_only: { allowed_sip_ips, tech_prefix }
|
|
86
158
|
# - credentials_and_ip: { allowed_sip_ips, tech_prefix, username, password }
|
data/lib/didww/types/strings.rb
CHANGED
data/lib/didww/types.rb
CHANGED
|
@@ -6,9 +6,11 @@ require 'didww/types/strings'
|
|
|
6
6
|
require 'didww/complex_objects/base'
|
|
7
7
|
require 'didww/complex_objects/export_filters'
|
|
8
8
|
require 'didww/complex_objects/authentication_method'
|
|
9
|
+
require 'didww/complex_objects/sms_trunk_configuration'
|
|
9
10
|
|
|
10
11
|
JsonApiClient::Schema.register ip_addresses: DIDWW::Types::IpAddresses,
|
|
11
12
|
strings: DIDWW::Types::Strings,
|
|
12
13
|
complex_object: DIDWW::ComplexObject::Base,
|
|
13
14
|
export_filters: DIDWW::ComplexObject::ExportFilters,
|
|
14
|
-
authentication_method: DIDWW::ComplexObject::AuthenticationMethod::Base
|
|
15
|
+
authentication_method: DIDWW::ComplexObject::AuthenticationMethod::Base,
|
|
16
|
+
sms_trunk_configuration: DIDWW::ComplexObject::SmsTrunkConfiguration::Base
|
data/lib/didww/version.rb
CHANGED
data/lib/didww.rb
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
require 'didww/version'
|
|
3
|
+
require 'didww/errors'
|
|
4
|
+
require 'didww/http'
|
|
5
|
+
require 'didww/auth/token'
|
|
6
|
+
require 'didww/auth/memory_store'
|
|
7
|
+
require 'didww/auth/token_provider'
|
|
8
|
+
require 'didww/auth/bearer_middleware'
|
|
3
9
|
require 'didww/client'
|
|
4
10
|
require 'didww/types'
|
|
5
11
|
require 'didww/base_middleware'
|
|
6
12
|
require 'didww/jsonapi_middleware'
|
|
7
13
|
require 'didww/callback/request_validator'
|
|
8
14
|
require 'didww/encrypt'
|
|
15
|
+
require 'didww/prices'
|