-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config to control the behavior of the CallsMonitoring job #1527
Conversation
e1067f2
to
c98a95d
Compare
be8f6e7
to
7a2d9cd
Compare
@dmitry-sinina this PR is ready to code review |
689c997
to
f1778a9
Compare
@dmitry-sinina this PR is ready to code review |
if disabled_orig_gw_active_calls.key?(call[:orig_gw_id]) | ||
terminate_calls_for_disabled_orig_gw(call) | ||
elsif disabled_term_gw_active_calls.key?(call[:term_gw_id]) | ||
terminate_calls_for_disabled_term_gw(call) | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better would be to split detect_gateway_calls_to_reject
into 2 methods: detect_orig_gateway_calls_to_reject
and detect_term_gateway_calls_to_reject
and use same approach that was used in detect_customers_auth_calls_to_reject
P.S. also please refactor adding calls to @terminate_calls
, they all should use terminate_calls
method
def detect_orig_gateway_calls_to_reject
return unless teardown_enabled?(:teardown_on_disabled_orig_gw)
calls_to_terminate = flatten_calls.select do |call|
disabled_orig_gw_active_calls.key?(call[:orig_gw_id])
end
terminate_calls(calls_to_terminate)
end
def detect_term_gateway_calls_to_reject
return unless teardown_enabled?(:teardown_on_disabled_term_gw)
# same
end
def terminate_calls(calls)
@terminate_calls.merge!(calls.index_by { |c| c[:local_tag] })
end
0fc61bf
to
5edfe3c
Compare
@senid231 just appliyed your last suggestion. |
new config variables should be described there: https://github.com/yeti-switch/yeti-web/blob/master/config/initializers/_config.rb#L25 |
introduces new configuration options in yeti_web.yml to control the behavior of the CallsMonitoring job when dealing with disabled customer authentication and both origination/termination gateways: - calls_monitoring.teardown_on_disabled_customer_auth - calls_monitoring.teardown_on_disabled_term_gw - calls_monitoring.teardown_on_disabled_orig_gw The CallsMonitoring class has been updated to use these configurations in the relevant methods. If the configs are not present, the current flow should not be changed.
5edfe3c
to
31cb475
Compare
just appliyed your last suggestion |
Description
add config to control the behavior of the CallsMonitoring job
introduces new configuration options in yeti_web.yml to control
the behavior of the CallsMonitoring job when dealing with
disabled customer authentication and both origination/termination gateways:
The CallsMonitoring class has been updated to use these
configurations in the relevant methods. If the configs
are not present, the current flow should not be changed.
Additional links
closes #1526