我只是對那些知識淵博的解析,雲代碼,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返回。您需要在成功和錯誤中添加快速返回語句。 –