twilio-opencode

A lightweight express server to handle Twilio voice and messaging webhooks for prompting Opencode.
git clone https://unitehenry.com/git/twilio-opencode.git
Log | Files | Refs | README | LICENSE

commit 2347a9843fb9ce2578b358fba24904ecf5959c25
parent 8c8be6b720fdbd1ca1e316400df00c7ea2158e1d
Author: Henry Unite <henry@getpoint.io>
Date:   Thu, 26 Feb 2026 09:42:22 -0800

feat: hangup

Diffstat:
Mvoice.ts | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/voice.ts b/voice.ts @@ -13,6 +13,18 @@ function buildResponse(message: string): string { `; } +function hangup(res: Response): void { + const responseXml = `<?xml version="1.0" encoding="UTF-8"?> + <Response> + <Hangup /> + </Response> + `; + + res.set("Content-Type", "text/xml"); + + res.send(responseXml); +} + export default async (req: Request, res: Response): Promise<void> => { const app = req.app; @@ -25,6 +37,8 @@ export default async (req: Request, res: Response): Promise<void> => { if (!whitelist(from)) { log("WARN", "Phone number not whitelisted", { callId, from }); + hangup(res); + return; }