Make sure numbers starting with 911 still work

Stephen Paul Weber created

Change summary

lib/call_attempt_repo.rb |  2 +-
test/test_web.rb         | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)

Detailed changes

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

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(
+			"<?xml version=\"1.0\" encoding=\"utf-8\" ?><Response>" \
+			"<Transfer transferCallerId=\"+15551234567\">" \
+			"<PhoneNumber>+19116</PhoneNumber></Transfer></Response>",
+			last_response.body
+		)
+	end
+	em :test_outbound_supported_9116
+
 	def test_outbound_atlimit
 		post(
 			"/outbound/calls",