Update voiceai-server.js
This commit is contained in:
@@ -50,7 +50,6 @@ app.post('/respond',async(req,res)=>{
|
|||||||
console.log('Reply ready for',sid,':',pending[sid]);
|
console.log('Reply ready for',sid,':',pending[sid]);
|
||||||
});
|
});
|
||||||
const t=new twilio.twiml.VoiceResponse();
|
const t=new twilio.twiml.VoiceResponse();
|
||||||
t.say({voice:'Polly.Joanna-Neural'},'One moment please.');
|
|
||||||
t.pause({length:1});
|
t.pause({length:1});
|
||||||
t.redirect({method:'POST'},'https://voice.onsethost.com/check?sid='+sid+'&attempt=0');
|
t.redirect({method:'POST'},'https://voice.onsethost.com/check?sid='+sid+'&attempt=0');
|
||||||
res.type('text/xml');res.send(t.toString());
|
res.type('text/xml');res.send(t.toString());
|
||||||
@@ -70,7 +69,7 @@ app.post('/check',async(req,res)=>{
|
|||||||
g.say({voice:'Polly.Joanna-Neural'},reply);
|
g.say({voice:'Polly.Joanna-Neural'},reply);
|
||||||
t.say({voice:'Polly.Joanna-Neural'},'Thank you for calling. Goodbye!');
|
t.say({voice:'Polly.Joanna-Neural'},'Thank you for calling. Goodbye!');
|
||||||
t.hangup();
|
t.hangup();
|
||||||
} else if(attempt<20){
|
} else if(attempt<30){
|
||||||
t.pause({length:1});
|
t.pause({length:1});
|
||||||
t.redirect({method:'POST'},'https://voice.onsethost.com/check?sid='+sid+'&attempt='+(attempt+1));
|
t.redirect({method:'POST'},'https://voice.onsethost.com/check?sid='+sid+'&attempt='+(attempt+1));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user