Javascript 如何在Twilio Studio的自定义函数中使用变量?
我想使用Twilio Studio中的变量,例如Javascript 如何在Twilio Studio的自定义函数中使用变量?,javascript,twilio,twilio-functions,twilio-studio,Javascript,Twilio,Twilio Functions,Twilio Studio,我想使用Twilio Studio中的变量,例如trigger.message.from变量(我相信它包含发送者的电话号码) 不幸的是,这些变量没有传递到my函数中的事件对象: exports.handler = function(context, event, callback) { console.log("received event: " + JSON.stringify(event, null, 4)); }; 印刷品: 收到的事件:{} 变量需要在运行函数配置中作为参数传递
trigger.message.from
变量(我相信它包含发送者的电话号码)
不幸的是,这些变量没有传递到my函数中的事件对象:
exports.handler = function(context, event, callback) {
console.log("received event: " + JSON.stringify(event, null, 4));
};
印刷品:
收到的事件:{}
变量需要在运行函数
配置中作为参数传递。例如,添加带有Keycaller
和Value{{{trigger.message.From}
的参数应将此变量注入事件
对象:
exports.handler = function(context, event, callback) {
console.log("caller is: " + event.caller);
};
尝试拨打Twilio号码,您会看到您的号码:
主叫人:+1xxxxxx