我只是对那些知识渊博的解析,云代码,Twilio和快速超快速的问题...调用从快速解析云代码功能GET方法
基本上我已经设置了Node.js的快速功能它处理GET的特定URL,Twilio每当有人拨打电话号码时都会调用该URL,并且我想从GET处理函数中调用一个Parse Cloud Code函数,通知用户的帐号与该特定号码相关联。
因此我的问题是在下面的代码示例中是否会调用Parse Cloud函数“notifyConferenceNumberOwner”。
app.get('/conf', function(request, response) {
var phoneNumber = request.query['To'];
var twiml = new twilio.TwimlResponse();
twiml.say('Your conference call will begin momentarily.',
{
voice:'woman',
language:'en-gb'
})
.dial({
action:'http://url-to-call-status',
method:'GET'
},
function(node) {
node.conference('MyConference', {
waitUrl:'http://twimlets.com/holdmusic?Bucket=com.twilio.music.guitars',
startConferenceOnEnter:'true',
beep:'true'
});
});
response.type('text/xml');
response.send(twiml.toString());
Parse.Cloud.run('notifyConferenceNumberOwner', { conferenceCallNumber: phoneNumber }, {
success: function(ratings) {
console.log('*** NOTIFICATION SUCCEEDED');
},
error: function(error) {
console.error('*** NOTIFICATION FAILED: ' + error);
}
});
});
我希望这会工作,但它似乎失败了我的情况...让我知道如果我失去了一些东西。
谢谢!
这种失败的方式是什么?正如你收到NOTIFICATION FAILED事件?如果是这样,错误是什么? 你忽略的一件事是你没有从app.get返回。您需要在成功和错误中添加快速返回语句。 –