Calling using twilio API from the browser. Useful for testing when developing phone calling based software. Uses @twilio/voice-sdk
.
In twilio create a new number and an app, e.g. twilio-caller
and link it to the number. Also create an API key.
Then create a Function in Twilio with path /twilio-caller/handle-call
and set the app's Webhook (Request URL) to the full URL of the function. This function will simply forward the call to @twilio/voice-sdk
in the browser:
const assert = require('node:assert'); exports.handler = function(context, event, callback) { const callerId = '+123456789'; // Update with your twilio number // Only handle outgoing calls assert(event.To !== callerId.replaceAll(/[^\d+]/g, '')); const twiml = new Twilio.twiml.VoiceResponse(); // set the callerId (from) let dial = twiml.dial({ callerId }); dial.number(event.To); callback(null, twiml); };
Ref:
Make sure you have Node.js. Now check out this repo and run yarn
. Make a .env
file with data from Twilio admin:
TWILIO_ACCOUNT_SID
TWIML_APP_SID
TWILIO_API_KEY
TWILIO_API_SECRET
Next generate a token:
node --experimental-strip-types makeAccessToken.tsStart the UI server and open it in your browser.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4