我正在尝试使用以下代码设置twilio帐户并添加功能:
exports.handler = function(context, event, callback) {
//let twiml = new Twilio.twiml.VoiceResponse();
//callback(null, twiml);
callback(null,{data:context});
//Start Rahul Mishra here
const AccessToken = Twilio.jwt.AccessToken;
const VoiceGrant = AccessToken.VoiceGrant;
const token = new AccessToken(context.ACCOUNT_SID, context.API_KEY, context.API_SECRET);
token.identity = event.identity;
const voiceGrant = new VoiceGrant({
room:'DailyStandup'
});
token.addGrant(voiceGrant);
callback(null, {token: token.toJwt() });
//End here
};
以下是响应:
Unauthorized - you do not have permission to perform this request
请让我知道我在做什么错...谢谢!