Tag: twiml

从twilio访问transcriptionText

我想访问转录文本,这些文本是通过在我的Twilio账户中转录生成的,因为我想将用户logging的响应作为文本进行比较 twiml.say('Hi there! Please speak your response after the beep,-Get ready!') .record({ transcribe:true, timeout:5, maxLength:30, transcribeCallback:'/recording', action:'/recording' }); app.post('/recording', (request,response) => { if(transcriptionText=='yes'){ twiml.say('thank you for positive response'); } response.type('text/xml'); response.send(twiml.toString()); });

节点js twilio发送短信不起作用

我有这个函数sendms var twiml = new MessagingResponse(); function sendsms() { twiml.message("aaa"); console.log(twiml.toString()); } 但是当我在User.findone中调用这个函数 User.findOne({}, function(err, user) { if (condition) { sendsms(); } }) 它成功地logging了twiml.toString 但短信不发送 当我呼叫外部user.findOne短信发送成功 sendsms() 这是发送短信的路线 router.post('/sendSMS', function(req, res) { var phone = req.body.phone; User.findOne({}, function(err, user) { require('../config/sendSMS')(user, phone); res.status(200).json({ success: true, message: 'message sent successfully' }); } }); 这是获取和重播短信的路线 router.post('/getSMS', function(req, […]

Twilio – logging一个排队的电话

我正在使用NodeJS与Twilio一起编写语音演示。 使用<enqueue>动词 ,传入的呼叫被放置在队列中,如下所示: <?xml version="1.0" encoding="UTF-8"?> <Response> <Enqueue waitUrl="/wait.xml">support</Enqueue> </Response> 在wait.xml中,我暂停并等待第二个客户端从队列中接收呼叫: <?xml version="1.0" encoding="UTF-8" ?> <Response> <Say voice="alice">Connecting to representative</Say> <Pause length="100"/> <Leave/> </Response> 当第二个客户端启动时,它使用<Dial>来使呼叫出列: <?xml version="1.0" encoding="UTF-8"?> <Response> <Dial record="record-from-answer" action="./record" method="GET"> <Queue>support</Queue> </Dial> </Response> 除通话logging外,所有function都按预期工作。 调用<client>时使用相同的原则,工作正常。 我错过了什么?

Twiml POST请求上的空参数

一点背景。 我有一个运行的Web应用程序试图从Twilio接收传入的文本。 我已经configurationTwilio的短信url指向我的应用程序在路线: http://my-app-name.com/api/twiml 当请求被执行时,我执行了一些代码: if (Meteor.server) { // use picker to make a server side route Picker.route('/api/twiml', (params, req, res, next) => { console.log(util.inspect(params, {showHidden: true, colors: true})); console.log(util.inspect(req.body, {showHidden: true, colors: true})); // message data (not populating?) let messageSid = params.query.MessageSid, accountSid = params.query.AccountSid, from = params.query.From, to = params.query.To, body = params.query.Body; […]