Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const voice = async (req, res) => {
- const user = await Requester.findOne({
- where: {
- phone_number: req.body.From
- }
- })
- const twiml = new VoiceResponse();
- if (user !== null) {
- twiml.say({voice: 'Polly.Joanna'}, 'Twoja prosba zostala przyjeta, wolontariusz za chwile do ciebie oddzwoni!');
- } else {
- twiml.say({voice: 'Polly.Joanna'}, 'Podaj swoj adres');
- twiml.record({
- timeout: 10,
- maxLength: 30,
- transcribe: true,
- transcribe_callback: '/twilio/transcribe',
- })
- twiml.hangup()
- }
- res.type('text/xml');
- res.send(twiml.toString());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement