From 5ab9af219a04893ec2822b36dd290e3eda545f7f Mon Sep 17 00:00:00 2001 From: Chris Gaffney Date: Thu, 16 Jan 2025 13:36:39 -0500 Subject: [PATCH] Add option to temporarily forward calls to a specific number --- README.md | 8 ++++++++ views/welcome.builder | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eaf7d14..9c42cc8 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,12 @@ This is purposely minimal and unexciting. However, feel free to use, change, and Using it? Tell us how and where. We'd love to hear! +## Configuration + +### FORWARD_PHONE_TO + +Set this to a phone number to temporarily forward all calls to that number. +Must include area code and not have any spaces or other special characters +(e.g. 5558675309). + © 2014-2018, 2022 [Collective Idea](https://collectiveidea.com/) diff --git a/views/welcome.builder b/views/welcome.builder index 48b4754..c2e6ac4 100644 --- a/views/welcome.builder +++ b/views/welcome.builder @@ -1,4 +1,9 @@ -xml.Gather timeout: 5, action: "/menu", numDigits: "1" do |g| - g.Play sound_url("welcome") +if ENV["FORWARD_PHONE_TO"].present? + # Number must include area code and not have any other special characters. + xml.Dial ENV["FORWARD_PHONE_TO"] +else + xml.Gather timeout: 5, action: "/menu", numDigits: "1" do |g| + g.Play sound_url("welcome") + end + xml.Hangup end -xml.Hangup