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 9aba29d518bf3c98cc7f0d6d1b662a48bddd0f6e
parent d28ee4637cdf1cbd22ee33dacb30e14163cc39fa
Author: Henry Unite <henry@getpoint.io>
Date:   Thu, 26 Feb 2026 10:57:11 -0800

feat: twilio messaging service

Diffstat:
Mapp.ts | 2++
Mmessage.ts | 2+-
Mwhitelist.ts | 2+-
3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/app.ts b/app.ts @@ -9,6 +9,8 @@ const app = express(); const validate = !!process.env.TWILIO_AUTH_TOKEN; +app.set('trust proxy', true); + app.use(express.urlencoded({ extended: false })); app.post("/voice", twilio.webhook({ validate }), voice); diff --git a/message.ts b/message.ts @@ -80,7 +80,7 @@ export default async (req: Request, res: Response): Promise<void> => { const sendMessageParams = { twilioAccountSid, twilioAuthToken, - fromNumber: req.body.to, + fromNumber: req.body.To, toNumber: from, message: text, }; diff --git a/whitelist.ts b/whitelist.ts @@ -1,5 +1,5 @@ export default (number: string): boolean => { - if (!process.env.FROM_WHITELIST) return; + if (!process.env.FROM_WHITELIST) return true; return process.env.FROM_WHITELIST.split(",") .map((phone) => phone.trim())