Я пытаюсь использовать функцию Twilio для перевода вызова на телефонный номер с добавочным номером.
Функция Twilio вызывается из потока Twilio.
Сейчаспереадресация на номер телефона.Однако расширение никогда не вызывается.
Я добавил несколько символов "w" для паузы в "sendDigits" ... но это ничего не изменило.
Вот мойTwilio flow
Вот мой виджет функции Twilio с параметром
Вот код функции twilio
exports.handler = function(context, event, callback) {
// set-up the variables that this Function will use to forward a phone call using TwiML
// REQUIRED - you must set this
let phoneNumber = event.PhoneNumber || "NUMBER TO FORWARD TO";
// OPTIONAL
let callerId = event.CallerId || null;
// OPTIONAL
let timeout = event.Timeout || null;
// OPTIONAL
let allowedCallers = event.allowedCallers || [];
// generate the TwiML to tell Twilio how to forward this call
let twiml = new Twilio.twiml.VoiceResponse();
let allowedThrough = true;
if (allowedCallers.length > 0) {
if (allowedCallers.indexOf(event.From) === -1) {
allowedThrough = false;
}
}
let sendDigits = event.sendDigits;
let dialParams = {};
dialParams.sendDigits = sendDigits
if (callerId) {
dialParams.callerId = callerId;
}
if (timeout) {
dialParams.timeout = timeout;
}
if (allowedThrough) {
twiml.dial(dialParams, phoneNumber);
}
else {
twiml.say('Sorry, you are calling from a restricted number. Good bye.');
}
// return the TwiML
callback(null, twiml);
};
Любойидея?