From 1e8c8a7900e959896c9d52f1c18527987e005b99 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 14 May 2024 21:14:57 -0500 Subject: [PATCH] Make sure numbers starting with 911 still work --- lib/call_attempt_repo.rb | 2 +- test/test_web.rb | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/call_attempt_repo.rb b/lib/call_attempt_repo.rb index 0aed365720435be88ee27c72bd4b911fbcd1b3fd..4fa0d98bfc0f2fe5cef92d7232db9abfc07417a7 100644 --- a/lib/call_attempt_repo.rb +++ b/lib/call_attempt_repo.rb @@ -62,7 +62,7 @@ protected supported: rate && tl.support_call?(rate, c || 0) && - other_tel !~ /\A\+?1?[94]11/, + other_tel !~ /\A\+?1?[94]11\Z/, direction: direction, **kwargs ) end diff --git a/test/test_web.rb b/test/test_web.rb index 0f34bdab14cf5e4c260eb3367c6dbecb0c66a671..8b76b43dad70b82aa9fd0ec3872bc4542605e3f1 100644 --- a/test/test_web.rb +++ b/test/test_web.rb @@ -111,6 +111,7 @@ class WebTest < Minitest::Test db: FakeDB.new( ["test_usd", "+15557654321", :outbound] => [{ "rate" => 0.01 }], ["test_usd", "+1911", :outbound] => [{ "rate" => 0.01 }], + ["test_usd", "+19116", :outbound] => [{ "rate" => 0.01 }], ["test_usd", "+15557654321", :inbound] => [{ "rate" => 0.01 }], ["test_usd", "+14445556666", :inbound] => [{ "rate" => 0.01 }], ["test_usd", "+18001234567", :outbound] => [{ "rate" => 0.00 }], @@ -294,6 +295,27 @@ class WebTest < Minitest::Test end em :test_outbound_unsupported_short_numbers_911 + def test_outbound_supported_9116 + post( + "/outbound/calls", + { + from: "ccustomerid", + to: "+19116", + callId: "acall" + }.to_json, + { "CONTENT_TYPE" => "application/json" } + ) + + assert last_response.ok? + assert_equal( + "" \ + "" \ + "+19116", + last_response.body + ) + end + em :test_outbound_supported_9116 + def test_outbound_atlimit post( "/outbound/calls",