Skip to content

Commit 72bce99

Browse files
feat: make funlet-whisper Quick Deployable
1 parent 670e4e1 commit 72bce99

File tree

3 files changed

+98
-2
lines changed

3 files changed

+98
-2
lines changed

funlet-whisper/.env

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# description: If "true", check that the recipient is human by having them press a button.
2+
# format: text
3+
FUNLET_WHISPER_HUMAN_CHECK=false
4+
15
# description: The path to the webhook
26
# configurable: false
3-
TWILIO_VOICE_WEBHOOK_URL=/funlet-whisper
7+
TWILIO_VOICE_WEBHOOK_URL=/funlet-whisper

funlet-whisper/assets/index.html

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="x-ua-compatible" content="ie=edge">
7+
<title>Get started with your Twilio Functions!</title>
8+
9+
<link rel="icon" href="https://twilio-labs.github.io/function-templates/static/v1/favicon.ico">
10+
<link rel="stylesheet" href="https://twilio-labs.github.io/function-templates/static/v1/ce-paste-theme.css">
11+
12+
<script src="https://twilio-labs.github.io/function-templates/static/v1/ce-helpers.js" defer></script>
13+
<script>
14+
window.addEventListener('DOMContentLoaded', (_event) => {
15+
inputPrependBaseURL();
16+
});
17+
</script>
18+
</head>
19+
<body>
20+
<div class="page-top">
21+
<header>
22+
<div id="twilio-logo">
23+
<a href="https://www.twilio.com/" target="_blank" rel="noopener">
24+
<svg class="logo" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 60 60">
25+
<title>Twilio Logo</title><path class="cls-1" d="M30,15A15,15,0,1,0,45,30,15,15,0,0,0,30,15Zm0,26A11,11,0,1,1,41,30,11,11,0,0,1,30,41Zm6.8-14.7a3.1,3.1,0,1,1-3.1-3.1A3.12,3.12,0,0,1,36.8,26.3Zm0,7.4a3.1,3.1,0,1,1-3.1-3.1A3.12,3.12,0,0,1,36.8,33.7Zm-7.4,0a3.1,3.1,0,1,1-3.1-3.1A3.12,3.12,0,0,1,29.4,33.7Zm0-7.4a3.1,3.1,0,1,1-3.1-3.1A3.12,3.12,0,0,1,29.4,26.3Z"/></svg>
26+
</a>
27+
</div>
28+
<nav>
29+
<span>Your Twilio application</span>
30+
<aside>
31+
<svg class="icon" role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="NewIcon-1577"><path fill="currentColor" fill-rule="evenodd" d="M6.991 7.507c.003-.679 1.021-.675 1.019.004-.012 2.956 1.388 4.41 4.492 4.48.673.016.66 1.021-.013 1.019-2.898-.011-4.327 1.446-4.48 4.506-.033.658-1.01.639-1.018-.02-.03-3.027-1.382-4.49-4.481-4.486-.675 0-.682-1.009-.008-1.019 3.02-.042 4.478-1.452 4.49-4.484zm.505 2.757l-.115.242c-.459.9-1.166 1.558-2.115 1.976l.176.08c.973.465 1.664 1.211 2.083 2.22l.02.05.088-.192c.464-.973 1.173-1.685 2.123-2.124l.039-.018-.118-.05c-.963-.435-1.667-1.117-2.113-2.034l-.068-.15zm10.357-8.12c.174.17.194.434.058.625l-.058.068-1.954 1.905 1.954 1.908a.482.482 0 010 .694.512.512 0 01-.641.056l-.07-.056-1.954-1.908-1.954 1.908a.511.511 0 01-.71 0 .482.482 0 01-.058-.626l.058-.068 1.954-1.908-1.954-1.905a.482.482 0 010-.693.512.512 0 01.64-.057l.07.057 1.954 1.905 1.954-1.905a.511.511 0 01.71 0z"></path></svg>
32+
Live
33+
</aside>
34+
</nav>
35+
</header>
36+
</div>
37+
<main>
38+
<div class="content">
39+
<h1>
40+
<img src="https://twilio-labs.github.io/function-templates/static/v1/success.svg" />
41+
<div>
42+
<p>Welcome!</p>
43+
<p>Your live application with Twilio is ready to use!</p>
44+
</div>
45+
</h1>
46+
<section>
47+
<h2>Get started with your application</h2>
48+
<p>
49+
Now that your code is deployed, here are the last steps you need to do to finish your app.
50+
</p>
51+
<p>
52+
This Twilio Function will say a message and request to press a digit
53+
to check that the caller is human, and not a voicemail. If the check is
54+
requested and no digits are pressed, hang up.
55+
This Function is based on the undocumented <code>whisper.php</code> Twimlet,
56+
and may be used as its drop-in replacement.
57+
</p>
58+
<ol class="steps">
59+
<li>Call your Twilio phone number</li>
60+
<li>If you have the human check enabled, press a digit to connect the call</li>
61+
</ol>
62+
</section>
63+
64+
<section>
65+
<!-- APP_INFO_V2 -->
66+
</section>
67+
<section>
68+
<h2>Troubleshooting</h2>
69+
<ul>
70+
<li>
71+
Check the
72+
<a href="https://www.twilio.com/console/phone-numbers/incoming"
73+
target="_blank"
74+
rel="noopener">
75+
phone number configuration
76+
</a>
77+
and make sure the Twilio phone number you want for your app has a voice webhook
78+
configured to point at the following URL
79+
<form>
80+
<label for="twilio-webhook">Webhook URL</label>
81+
<input type="text" id="twilio-webhook" class="function-root" readonly=true value="/funlet-whisper">
82+
</form>
83+
</li>
84+
</ul>
85+
</section>
86+
</div>
87+
</main>
88+
<footer>
89+
<span class="statement">We can't wait to see what you build.</span>
90+
</footer>
91+
</body>
92+
</html>

test/all-templates.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { parser } = require('configure-env');
99

1010
// skipList is a list of function templates that don't pass verification
1111
// for now, but will in the long term
12-
const skipList = ['conversations', 'funlet-whisper', 'vaccine-standby'];
12+
const skipList = ['conversations', 'vaccine-standby'];
1313
const excludedPaths = ['node_modules', 'test', 'coverage', 'docs', 'blank'] + skipList;
1414
const projectRoot = path.resolve(__dirname, '..');
1515
// Assemble a list of template directories here, since templates.json

0 commit comments

Comments
 (0)