Skip to content

Commit

Permalink
fix default routing simulation interface (#1536)
Browse files Browse the repository at this point in the history
* fix default routing simulation interface
  • Loading branch information
dmitry-sinina authored Aug 24, 2024
1 parent 0f31aa7 commit 1da3a7b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/admin/cdr/cdrs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def scoped_collection
routing_simulation: {
auth_id: resource.customer_auth&.require_incoming_auth ? resource.orig_gw_id : nil,
transport_protocol_id: proto,
interface: YetiConfig.routing_simulation_default_interface,
remote_ip: resource.auth_orig_ip,
remote_port: resource.auth_orig_port,
src_number: resource.src_prefix_in,
Expand Down
2 changes: 1 addition & 1 deletion app/views/routing_simulation/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= form.inputs do %>
<%= form.input :auth_id, label:"Authorized gateway", collection: Gateway.where("incoming_auth_password is not null and allow_origination"), as: :select, include_blank: 'None', input_html: { class: 'chosen' } %>
<%= form.input :transport_protocol_id, collection: Equipment::TransportProtocol.all, as: :select, include_blank: false %>
<%= form.input :interface, input_html: { value: form.object.interface || 'primary' } %>
<%= form.input :interface, input_html: { value: form.object.interface || YetiConfig.routing_simulation_default_interface } %>
<%= form.input :remote_ip %>
<%= form.input :remote_port %>
<%= form.input :pop_id, collection: Pop.all, as: :select, include_blank: false %>
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def self.setting_files(config_root, _env)

optional(:rec_format).value(Dry::Types['string'].enum('wav', 'mp3'))

optional(:routing_simulation_default_interface).filled(:string)

required(:cdr_export).schema do
required(:dir_path).filled(:string)
required(:delete_url).filled(:string)
Expand Down
3 changes: 3 additions & 0 deletions config/yeti_web.yml.ci
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ cryptomus:
url_callback: 'https://your_domain.com/api/cryptomus_callbacks'
url_return: 'https://example.com'


routing_simulation_default_interface: internal

2 changes: 2 additions & 0 deletions config/yeti_web.yml.development
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ keep_balance_notifications_days: 30

api_log_tags:
- SOME_TAG_FOR_API_LOG

routing_simulation_default_interface: internal
2 changes: 2 additions & 0 deletions config/yeti_web.yml.distr
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ keep_expired_destinations_days:

api_log_tags:
- SOME_TAG_FOR_API_LOG

routing_simulation_default_interface: internal
3 changes: 2 additions & 1 deletion spec/config/yeti_web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
merchant_id: a_kind_of(String),
url_callback: a_kind_of(String),
url_return: a_kind_of(String)
}
},
routing_simulation_default_interface: a_kind_of(String)
}
end

Expand Down

0 comments on commit 1da3a7b

Please sign in to comment.