import { Twilio } from "twilio";
type Twilio = {
accountSid: string;
token: string;
};
export async function main(
twilio: Twilio,
fromPhoneNumber: string,
toPhoneNumber: string,
text: string
) {
const client = new Twilio(twilio.accountSid, twilio.token);
const call = await client.calls.create({
url:
"http://twimlets.com/echo?Twiml=<Response><Say>" +
encodeURIComponent(text) +
"</Say></Response>",
to: toPhoneNumber,
from: fromPhoneNumber,
});
return call;
}
Submitted by hugo697 468 days ago