From e4ec9b8eb368ed0997887ebd99f8c79982640d20 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 17 May 2022 08:36:51 -0500 Subject: [PATCH] Move between accounts requires a sip peer id --- config-schema.dhall | 2 +- config.dhall.sample | 2 +- lib/bandwidth_tn_repo.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config-schema.dhall b/config-schema.dhall index fa5754d19ade83c443a89e1e2eaf4dc52d368c53..e34ee2e19c4df5c62ae988e3095a697662a6cdd5 100644 --- a/config-schema.dhall +++ b/config-schema.dhall @@ -20,7 +20,7 @@ forall (address : Text) -> forall (customer_id : Text) -> Text , interac : Text , keep_area_codes : List Text -, keep_area_codes_in : { account : Text, site : Text } +, keep_area_codes_in : { account : Text, sip_peer_id : Text, site_id : Text } , notify_admin : Text , notify_from : Text , ogm_path : Text diff --git a/config.dhall.sample b/config.dhall.sample index 72323b4777f5f7e5a56614c47f8bd4417dc16aa2..b16a3c4430d02f008c1ecd0402fafe08d4a79dad 100644 --- a/config.dhall.sample +++ b/config.dhall.sample @@ -78,7 +78,7 @@ in admins = ["test\\40example.com@example.net"], unbilled_targets = ["+14169938000"], keep_area_codes = ["555"], - keep_area_codes_in = { account = "", site = "" }, + keep_area_codes_in = { account = "", site_id = "", sip_peer_id = "" }, upstream_domain = "example.net", approved_domains = toMap { `example.com` = Some "customer_id" } } diff --git a/lib/bandwidth_tn_repo.rb b/lib/bandwidth_tn_repo.rb index 35ef4d7419a20ef53db152a5d878d3b61a0ba297..4dd8a53bc1e5535674eacd9999df9c5fe0070b37 100644 --- a/lib/bandwidth_tn_repo.rb +++ b/lib/bandwidth_tn_repo.rb @@ -32,9 +32,9 @@ class BandwidthTnRepo tn = tel.sub(/\A\+1/, "") if CONFIG[:keep_area_codes].find { |area| tn.start_with?(area) } BandwidthIris::Tn.new({ telephone_number: tn }, @move_client).move( - site_id: CONFIG[:keep_area_codes_in][:site], customer_order_id: order_name, - source_account_id: CONFIG[:creds][:account] + source_account_id: CONFIG[:creds][:account], + **CONFIG[:keep_area_codes_in].slice(:site_id, :sip_peer_id) ) else BandwidthIris::Disconnect.create(order_name, tn)