Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
samnang committed Aug 14, 2023
1 parent 31118ae commit 33f02ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/app/app/models/routing_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def address
result = national_dialing ? Phony.format(destination, format: :national, spaces: "") : destination
result.gsub!(/\D/, "")
result = username.present? ? client_gateway_address(result) : public_gateway_address(result)
result.prepend(dial_string_prefix) if dial_string_prefix.present?
result.prepend("+") if plus_prefix
result
end
Expand All @@ -25,12 +26,12 @@ def address

def client_gateway_address(destination)
services_client.build_client_gateway_dial_string(
destination: destination,
username: username
destination:,
username:,
)
end

def public_gateway_address(destination)
"#{dial_string_prefix}#{destination}@#{host}"
"#{destination}@#{host}"
end
end

0 comments on commit 33f02ee

Please sign in to comment.