didww-v3 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +3 -2
  4. data/lib/didww/callback/const.rb +14 -0
  5. data/lib/didww/callback/request_validator.rb +12 -3
  6. data/lib/didww/client.rb +44 -38
  7. data/lib/didww/complex_objects/base.rb +1 -3
  8. data/lib/didww/complex_objects/configurations/base.rb +142 -2
  9. data/lib/didww/complex_objects/configurations/sip_configuration.rb +33 -3
  10. data/lib/didww/complex_objects/export_filters.rb +26 -0
  11. data/lib/didww/{resources → resource}/address.rb +0 -0
  12. data/lib/didww/{resources → resource}/address_verification.rb +0 -0
  13. data/lib/didww/{resources → resource}/area.rb +0 -0
  14. data/lib/didww/{resources → resource}/available_did.rb +0 -0
  15. data/lib/didww/{resources → resource}/balance.rb +0 -0
  16. data/lib/didww/{resources → resource}/base.rb +0 -1
  17. data/lib/didww/{resources → resource}/capacity_pool.rb +0 -0
  18. data/lib/didww/{resources → resource}/city.rb +0 -0
  19. data/lib/didww/{resources → resource}/country.rb +0 -0
  20. data/lib/didww/{resources → resource}/did.rb +2 -2
  21. data/lib/didww/{resources → resource}/did_group.rb +12 -17
  22. data/lib/didww/{resources → resource}/did_group_type.rb +0 -0
  23. data/lib/didww/{resources → resource}/did_reservation.rb +0 -0
  24. data/lib/didww/{resources → resource}/encrypted_file.rb +0 -0
  25. data/lib/didww/{resources/cdr_export.rb → resource/export.rb} +12 -4
  26. data/lib/didww/{resources → resource}/identity.rb +0 -0
  27. data/lib/didww/{resources → resource}/order.rb +12 -13
  28. data/lib/didww/{resources → resource}/permanent_supporting_document.rb +0 -0
  29. data/lib/didww/{resources → resource}/pop.rb +0 -0
  30. data/lib/didww/{resources → resource}/proof.rb +0 -0
  31. data/lib/didww/{resources → resource}/proof_type.rb +0 -0
  32. data/lib/didww/{resources → resource}/public_key.rb +0 -0
  33. data/lib/didww/{resources → resource}/qty_based_pricing.rb +0 -0
  34. data/lib/didww/{resources → resource}/region.rb +0 -0
  35. data/lib/didww/{resources → resource}/requirement.rb +0 -0
  36. data/lib/didww/{resources → resource}/requirement_validation.rb +0 -0
  37. data/lib/didww/{resources → resource}/shared_capacity_group.rb +0 -0
  38. data/lib/didww/{resources → resource}/stock_keeping_unit.rb +0 -0
  39. data/lib/didww/{resources → resource}/supporting_document_template.rb +0 -0
  40. data/lib/didww/{resources/trunk.rb → resource/voice_in_trunk.rb} +39 -4
  41. data/lib/didww/{resources/trunk_group.rb → resource/voice_in_trunk_group.rb} +2 -2
  42. data/lib/didww/resource/voice_out_trunk.rb +75 -0
  43. data/lib/didww/resource/voice_out_trunk_regenerate_credential.rb +11 -0
  44. data/lib/didww/types/ip_addresses.rb +23 -0
  45. data/lib/didww/types/strings.rb +21 -0
  46. data/lib/didww/types.rb +12 -0
  47. data/lib/didww/version.rb +1 -1
  48. data/lib/didww.rb +1 -0
  49. metadata +40 -36
  50. data/lib/didww/complex_objects/cdr_export_filter.rb +0 -24
  51. data/lib/didww/complex_objects/configurations/const.rb +0 -150
  52. data/lib/didww/resources/trunk/const.rb +0 -47
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,14 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
  require 'didww/complex_objects/configurations'
3
- require 'didww/resources/trunk/const'
4
3
 
5
4
  module DIDWW
6
5
  module Resource
7
- class Trunk < Base
8
- include CONST
6
+ class VoiceInTrunk < Base
7
+ # Allowed values for trunk.cli_format
8
+ CLI_FORMAT_RAW = 'raw'
9
+ CLI_FORMAT_E164 = 'e164'
10
+ CLI_FORMAT_LOCAL = 'local'
11
+
12
+ CLI_FORMATS = {
13
+ CLI_FORMAT_RAW => 'Raw',
14
+ CLI_FORMAT_E164 => 'E.164',
15
+ CLI_FORMAT_LOCAL => 'Local'
16
+ }.freeze
17
+
18
+ # Configuration types
19
+ CONF_TYPE_SIP = 'sip_configurations'
20
+ CONF_TYPE_H323 = 'h323_configurations'
21
+ CONF_TYPE_IAX2 = 'iax2_configurations'
22
+ CONF_TYPE_PSTN = 'pstn_configurations'
23
+
24
+ CONF_TYPES = {
25
+ CONF_TYPE_SIP => 'SIP',
26
+ CONF_TYPE_H323 => 'H323',
27
+ CONF_TYPE_IAX2 => 'IAX2',
28
+ CONF_TYPE_PSTN => 'PSTN'
29
+ }.freeze
30
+
31
+ CONF_TYPE_CLASSES = {
32
+ CONF_TYPE_SIP => DIDWW::ComplexObject::SipConfiguration,
33
+ CONF_TYPE_H323 => DIDWW::ComplexObject::H323Configuration,
34
+ CONF_TYPE_IAX2 => DIDWW::ComplexObject::Iax2Configuration,
35
+ CONF_TYPE_PSTN => DIDWW::ComplexObject::PstnConfiguration
36
+ }.freeze
9
37
 
10
38
  has_one :pop
11
- has_one :trunk_group
39
+ has_one :voice_in_trunk_group
12
40
 
13
41
  property :priority, type: :integer
14
42
  # Type: Integer
@@ -63,6 +91,13 @@ module DIDWW
63
91
  attribute_will_change!(:configuration) if configuration
64
92
  end
65
93
 
94
+ def cli_format_human
95
+ CLI_FORMATS[cli_format]
96
+ end
97
+
98
+ def configuration_type_human
99
+ CONF_TYPES[configuration.type] if configuration
100
+ end
66
101
  end
67
102
  end
68
103
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  module DIDWW
3
3
  module Resource
4
- class TrunkGroup < Base
5
- has_many :trunks
4
+ class VoiceInTrunkGroup < Base
5
+ has_many :voice_in_trunks
6
6
 
7
7
  property :name, type: :string
8
8
  # Type: String
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'didww/callback/const'
4
+
5
+ module DIDWW
6
+ module Resource
7
+ class VoiceOutTrunk < Base
8
+ include DIDWW::Callback::CONST
9
+
10
+ ON_CLI_MISMATCH_ACTION_REJECT_CALL = 'Reject call'
11
+ ON_CLI_MISMATCH_ACTION_REPLACE_CLI = 'Replace CLI'
12
+ ON_CLI_MISMATCH_ACTION_SEND_ORIGINAL_CLI = 'Send Original CLI'
13
+
14
+ ON_CLI_MISMATCH_ACTIONS = [
15
+ ON_CLI_MISMATCH_ACTION_REJECT_CALL,
16
+ ON_CLI_MISMATCH_ACTION_REPLACE_CLI,
17
+ ON_CLI_MISMATCH_ACTION_SEND_ORIGINAL_CLI
18
+ ].freeze
19
+
20
+ DEFAULT_DST_ACTION_ALLOW_CALLS = 'Allow Calls'
21
+ DEFAULT_DST_ACTION_REJECT_CALLS = 'Reject Calls'
22
+
23
+ DEFAULT_DST_ACTIONS = [
24
+ DEFAULT_DST_ACTION_ALLOW_CALLS,
25
+ DEFAULT_DST_ACTION_REJECT_CALLS
26
+ ].freeze
27
+
28
+ STATUS_ACTIVE = 'Active'
29
+ STATUS_BLOCKED = 'Blocked'
30
+
31
+ STATUSES = [
32
+ STATUS_ACTIVE,
33
+ STATUS_BLOCKED
34
+ ].freeze
35
+
36
+ MEDIA_ENCRYPTION_MODE_DISABLE = 'Disable'
37
+ MEDIA_ENCRYPTION_MODE_SRTP_SDES = 'SRTP SDES'
38
+ MEDIA_ENCRYPTION_MODE_SRTP_DTLS = 'SRTP DTLS'
39
+ MEDIA_ENCRYPTION_MODE_ZRTP = 'ZRTP'
40
+
41
+ MEDIA_ENCRYPTION_MODES = [
42
+ MEDIA_ENCRYPTION_MODE_DISABLE,
43
+ MEDIA_ENCRYPTION_MODE_SRTP_SDES,
44
+ MEDIA_ENCRYPTION_MODE_SRTP_DTLS,
45
+ MEDIA_ENCRYPTION_MODE_ZRTP
46
+ ].freeze
47
+
48
+ property :name, type: :string
49
+ property :allowed_sip_ips, type: :ip_addresses
50
+ property :on_cli_mismatch_action, type: :string
51
+ property :capacity_limit, type: :integer
52
+ property :username, type: :string
53
+ property :password, type: :string
54
+ property :created_at, type: :time
55
+ property :allow_any_did_as_cli, type: :boolean
56
+ property :status, type: :string
57
+ property :threshold_reached, type: :boolean
58
+ property :threshold_amount, type: :decimal
59
+ property :default_dst_action, type: :string
60
+ property :dst_prefixes, type: :strings
61
+ property :media_encryption_mode, type: :string
62
+ property :callback_url, type: :string
63
+ property :force_symmetric_rtp, type: :boolean
64
+ property :allowed_rtp_ips, type: :ip_addresses
65
+
66
+ has_many :dids
67
+
68
+ def regenerate_credentials
69
+ resource = DIDWW::Resource::VoiceOutTrunkRegenerateCredential.new
70
+ resource.relationships[:voice_out_trunk] = self
71
+ resource.save
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'didww/callback/const'
4
+
5
+ module DIDWW
6
+ module Resource
7
+ class VoiceOutTrunkRegenerateCredential < Base
8
+ has_one :voice_out_trunk
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DIDWW
4
+ module Types
5
+ module IpAddresses
6
+ module_function
7
+
8
+ def cast(values, default)
9
+ return default unless values.is_a?(Array)
10
+
11
+ values.map do |value|
12
+ cast_item(value)
13
+ end
14
+ rescue IPAddr::Error
15
+ default
16
+ end
17
+
18
+ def cast_item(value)
19
+ value.is_a?(IPAddr) ? value : IPAddr.new(value)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DIDWW
4
+ module Types
5
+ module Strings
6
+ module_function
7
+
8
+ def cast(values, default)
9
+ return default unless values.is_a?(Array)
10
+
11
+ values.map do |value|
12
+ cast_item(value)
13
+ end
14
+ end
15
+
16
+ def cast_item(value)
17
+ value.to_s
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json_api_client/schema'
4
+ require 'didww/types/ip_addresses'
5
+ require 'didww/types/strings'
6
+ require 'didww/complex_objects/base'
7
+ require 'didww/complex_objects/export_filters'
8
+
9
+ JsonApiClient::Schema.register ip_addresses: DIDWW::Types::IpAddresses,
10
+ strings: DIDWW::Types::Strings,
11
+ complex_object: DIDWW::ComplexObject::Base,
12
+ export_filters: DIDWW::ComplexObject::ExportFilters
data/lib/didww/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module DIDWW
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '3.0.0'.freeze
4
4
  end
data/lib/didww.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require 'didww/version'
3
3
  require 'didww/client'
4
+ require 'didww/types'
4
5
  require 'didww/base_middleware'
5
6
  require 'didww/jsonapi_middleware'
6
7
  require 'didww/callback/request_validator'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: didww-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Korobeinikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -115,53 +115,57 @@ files:
115
115
  - didww-v3.gemspec
116
116
  - lib/didww.rb
117
117
  - lib/didww/base_middleware.rb
118
+ - lib/didww/callback/const.rb
118
119
  - lib/didww/callback/request_validator.rb
119
120
  - lib/didww/client.rb
120
121
  - lib/didww/complex_objects/base.rb
121
122
  - lib/didww/complex_objects/capacity_order_item.rb
122
- - lib/didww/complex_objects/cdr_export_filter.rb
123
123
  - lib/didww/complex_objects/configurations.rb
124
124
  - lib/didww/complex_objects/configurations/base.rb
125
- - lib/didww/complex_objects/configurations/const.rb
126
125
  - lib/didww/complex_objects/configurations/h323_configuration.rb
127
126
  - lib/didww/complex_objects/configurations/iax2_configuration.rb
128
127
  - lib/didww/complex_objects/configurations/pstn_configuration.rb
129
128
  - lib/didww/complex_objects/configurations/sip_configuration.rb
130
129
  - lib/didww/complex_objects/did_order_item.rb
130
+ - lib/didww/complex_objects/export_filters.rb
131
131
  - lib/didww/encrypt.rb
132
132
  - lib/didww/jsonapi_middleware.rb
133
- - lib/didww/resources/address.rb
134
- - lib/didww/resources/address_verification.rb
135
- - lib/didww/resources/area.rb
136
- - lib/didww/resources/available_did.rb
137
- - lib/didww/resources/balance.rb
138
- - lib/didww/resources/base.rb
139
- - lib/didww/resources/capacity_pool.rb
140
- - lib/didww/resources/cdr_export.rb
141
- - lib/didww/resources/city.rb
142
- - lib/didww/resources/country.rb
143
- - lib/didww/resources/did.rb
144
- - lib/didww/resources/did_group.rb
145
- - lib/didww/resources/did_group_type.rb
146
- - lib/didww/resources/did_reservation.rb
147
- - lib/didww/resources/encrypted_file.rb
148
- - lib/didww/resources/identity.rb
149
- - lib/didww/resources/order.rb
150
- - lib/didww/resources/permanent_supporting_document.rb
151
- - lib/didww/resources/pop.rb
152
- - lib/didww/resources/proof.rb
153
- - lib/didww/resources/proof_type.rb
154
- - lib/didww/resources/public_key.rb
155
- - lib/didww/resources/qty_based_pricing.rb
156
- - lib/didww/resources/region.rb
157
- - lib/didww/resources/requirement.rb
158
- - lib/didww/resources/requirement_validation.rb
159
- - lib/didww/resources/shared_capacity_group.rb
160
- - lib/didww/resources/stock_keeping_unit.rb
161
- - lib/didww/resources/supporting_document_template.rb
162
- - lib/didww/resources/trunk.rb
163
- - lib/didww/resources/trunk/const.rb
164
- - lib/didww/resources/trunk_group.rb
133
+ - lib/didww/resource/address.rb
134
+ - lib/didww/resource/address_verification.rb
135
+ - lib/didww/resource/area.rb
136
+ - lib/didww/resource/available_did.rb
137
+ - lib/didww/resource/balance.rb
138
+ - lib/didww/resource/base.rb
139
+ - lib/didww/resource/capacity_pool.rb
140
+ - lib/didww/resource/city.rb
141
+ - lib/didww/resource/country.rb
142
+ - lib/didww/resource/did.rb
143
+ - lib/didww/resource/did_group.rb
144
+ - lib/didww/resource/did_group_type.rb
145
+ - lib/didww/resource/did_reservation.rb
146
+ - lib/didww/resource/encrypted_file.rb
147
+ - lib/didww/resource/export.rb
148
+ - lib/didww/resource/identity.rb
149
+ - lib/didww/resource/order.rb
150
+ - lib/didww/resource/permanent_supporting_document.rb
151
+ - lib/didww/resource/pop.rb
152
+ - lib/didww/resource/proof.rb
153
+ - lib/didww/resource/proof_type.rb
154
+ - lib/didww/resource/public_key.rb
155
+ - lib/didww/resource/qty_based_pricing.rb
156
+ - lib/didww/resource/region.rb
157
+ - lib/didww/resource/requirement.rb
158
+ - lib/didww/resource/requirement_validation.rb
159
+ - lib/didww/resource/shared_capacity_group.rb
160
+ - lib/didww/resource/stock_keeping_unit.rb
161
+ - lib/didww/resource/supporting_document_template.rb
162
+ - lib/didww/resource/voice_in_trunk.rb
163
+ - lib/didww/resource/voice_in_trunk_group.rb
164
+ - lib/didww/resource/voice_out_trunk.rb
165
+ - lib/didww/resource/voice_out_trunk_regenerate_credential.rb
166
+ - lib/didww/types.rb
167
+ - lib/didww/types/ip_addresses.rb
168
+ - lib/didww/types/strings.rb
165
169
  - lib/didww/version.rb
166
170
  homepage: https://github.com/didww/didww-v3-ruby
167
171
  licenses:
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'json_api_client/schema'
3
-
4
- module DIDWW
5
- module ComplexObject
6
- class CdrExportFilter < Base
7
- # Type casting for JsonApiClient parser/setters
8
- def self.cast_single_object(hash)
9
- new(hash)
10
- end
11
-
12
- property :year, type: :integer
13
- property :month, type: :integer
14
- property :did_number, type: :string
15
-
16
- def as_json(*)
17
- super[:attributes]
18
- end
19
-
20
- end
21
- end
22
- end
23
-
24
- JsonApiClient::Schema.register cdr_export_filter: DIDWW::ComplexObject::CdrExportFilter
@@ -1,150 +0,0 @@
1
- # frozen_string_literal: true
2
- module DIDWW
3
- module ComplexObject
4
- module Configuration
5
- module CONST
6
- RX_DTMF_FORMATS = {
7
- 1 => 'RFC 2833' .freeze,
8
- 2 => 'SIP INFO application/dtmf-relay OR application/dtmf'.freeze,
9
- 3 => 'RFC 2833 OR SIP INFO' .freeze
10
- }.freeze
11
-
12
- TX_DTMF_FORMATS = {
13
- 0 => 'Disable sending' .freeze,
14
- 1 => 'RFC 2833' .freeze,
15
- 2 => 'SIP INFO application/dtmf-relay' .freeze,
16
- 4 => 'SIP INFO application/dtmf' .freeze
17
- }.freeze
18
-
19
- SST_REFRESH_METHODS = {
20
- 1 => 'Invite' .freeze,
21
- 2 => 'Update' .freeze,
22
- 3 => 'Update fallback Invite' .freeze
23
- }.freeze
24
-
25
- TRANSPORT_PROTOCOLS = {
26
- 1 => 'UDP' .freeze,
27
- 2 => 'TCP' .freeze
28
- }.freeze
29
-
30
- REROUTING_DISCONNECT_CODES = {
31
- 56 => '400 | Bad Request' .freeze,
32
- 57 => '401 | Unauthorized' .freeze,
33
- 58 => '402 | Payment Required' .freeze,
34
- 59 => '403 | Forbidden' .freeze,
35
- 60 => '404 | Not Found' .freeze,
36
- 64 => '408 | Request Timeout' .freeze,
37
- 65 => '409 | Conflict' .freeze,
38
- 66 => '410 | Gone' .freeze,
39
- 67 => '412 | Conditional Request Failed' .freeze,
40
- 68 => '413 | Request Entity Too Large' .freeze,
41
- 69 => '414 | Request-URI Too Long' .freeze,
42
- 70 => '415 | Unsupported Media Type' .freeze,
43
- 71 => '416 | Unsupported URI Scheme' .freeze,
44
- 72 => '417 | Unknown Resource-Priority' .freeze,
45
- 73 => '420 | Bad Extension' .freeze,
46
- 74 => '421 | Extension Required' .freeze,
47
- 75 => '422 | Session Interval Too Small' .freeze,
48
- 76 => '423 | Interval Too Brief' .freeze,
49
- 77 => '424 | Bad Location Information' .freeze,
50
- 78 => '428 | Use Identity Header' .freeze,
51
- 79 => '429 | Provide Referrer Identity' .freeze,
52
- 80 => '433 | Anonymity Disallowed' .freeze,
53
- 81 => '436 | Bad Identity-Info' .freeze,
54
- 82 => '437 | Unsupported Certificate' .freeze,
55
- 83 => '438 | Invalid Identity Header' .freeze,
56
- 84 => '480 | Temporarily Unavailable' .freeze,
57
- 86 => '482 | Loop Detected' .freeze,
58
- 87 => '483 | Too Many Hops' .freeze,
59
- 88 => '484 | Address Incomplete' .freeze,
60
- 89 => '485 | Ambiguous' .freeze,
61
- 90 => '486 | Busy Here' .freeze,
62
- 91 => '487 | Request Terminated' .freeze,
63
- 92 => '488 | Not Acceptable Here' .freeze,
64
- 96 => '494 | Security Agreement Required' .freeze,
65
- 97 => '500 | Server Internal Error' .freeze,
66
- 98 => '501 | Not Implemented' .freeze,
67
- 99 => '502 | Bad Gateway' .freeze,
68
- 100 => '503 | Service Unavailable' .freeze,
69
- 101 => '504 | Server Time-out' .freeze,
70
- 102 => '505 | Version Not Supported' .freeze,
71
- 103 => '513 | Message Too Large' .freeze,
72
- 104 => '580 | Precondition Failure' .freeze,
73
- 105 => '600 | Busy Everywhere' .freeze,
74
- 106 => '603 | Decline' .freeze,
75
- 107 => '604 | Does Not Exist Anywhere' .freeze,
76
- 108 => '606 | Not Acceptable' .freeze,
77
- 1505 => 'Ringing timeout' .freeze
78
- }.freeze
79
-
80
- CODECS = {
81
- 6 => 'telephone-event' .freeze,
82
- 7 => 'G723' .freeze,
83
- 8 => 'G729' .freeze,
84
- 9 => 'PCMU' .freeze,
85
- 10 => 'PCMA' .freeze,
86
- 12 => 'speex' .freeze,
87
- 13 => 'GSM' .freeze,
88
- 14 => 'G726-32' .freeze,
89
- 15 => 'G721' .freeze,
90
- 16 => 'G726-24' .freeze,
91
- 17 => 'G726-40' .freeze,
92
- 18 => 'G726-16' .freeze,
93
- 19 => 'L16' .freeze
94
- }.freeze
95
-
96
- DEFAULT_REROUTING_DISCONNECT_CODE_IDS = [
97
- 56,
98
- 58,
99
- 59,
100
- 60,
101
- 64,
102
- 65,
103
- 66,
104
- 67,
105
- 68,
106
- 69,
107
- 70,
108
- 71,
109
- 72,
110
- 73,
111
- 74,
112
- 75,
113
- 76,
114
- 77,
115
- 78,
116
- 79,
117
- 80,
118
- 81,
119
- 82,
120
- 83,
121
- 84,
122
- 86,
123
- 87,
124
- 88,
125
- 89,
126
- 90,
127
- 91,
128
- 92,
129
- 96,
130
- 97,
131
- 98,
132
- 99,
133
- 101,
134
- 102,
135
- 103,
136
- 104,
137
- 105,
138
- 106,
139
- 107,
140
- 108,
141
- 1505
142
- ].freeze
143
-
144
- DEFAULT_CODEC_IDS = [ 9, 10, 8, 7, 6 ].freeze
145
-
146
- DID_PLACEHOLDER = '{DID}'.freeze
147
- end
148
- end
149
- end
150
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
- module DIDWW
3
- module Resource
4
- class Trunk < Base
5
- module CONST
6
- # Allowed values for trunk.cli_format
7
- CLI_FORMAT_RAW = 'raw' .freeze
8
- CLI_FORMAT_E164 = 'e164' .freeze
9
- CLI_FORMAT_LOCAL = 'local' .freeze
10
-
11
- CLI_FORMATS = {
12
- CLI_FORMAT_RAW => 'Raw' .freeze,
13
- CLI_FORMAT_E164 => 'E.164' .freeze,
14
- CLI_FORMAT_LOCAL => 'Local' .freeze
15
- }.freeze
16
-
17
- # Configuration types
18
- CONF_TYPE_SIP = 'sip_configurations' .freeze
19
- CONF_TYPE_H323 = 'h323_configurations' .freeze
20
- CONF_TYPE_IAX2 = 'iax2_configurations' .freeze
21
- CONF_TYPE_PSTN = 'pstn_configurations' .freeze
22
-
23
- CONF_TYPES = {
24
- CONF_TYPE_SIP => 'SIP' .freeze,
25
- CONF_TYPE_H323 => 'H323' .freeze,
26
- CONF_TYPE_IAX2 => 'IAX2' .freeze,
27
- CONF_TYPE_PSTN => 'PSTN' .freeze
28
- }.freeze
29
-
30
- CONF_TYPE_CLASSES = {
31
- CONF_TYPE_SIP => DIDWW::ComplexObject::SipConfiguration,
32
- CONF_TYPE_H323 => DIDWW::ComplexObject::H323Configuration,
33
- CONF_TYPE_IAX2 => DIDWW::ComplexObject::Iax2Configuration,
34
- CONF_TYPE_PSTN => DIDWW::ComplexObject::PstnConfiguration
35
- }.freeze
36
-
37
- def cli_format_human
38
- CLI_FORMATS[cli_format]
39
- end
40
-
41
- def configuration_type_human
42
- CONF_TYPES[configuration.type] if configuration
43
- end
44
- end
45
- end
46
- end
47
- end