如果在下班时间未得到答复,则消息出现问题

时间:2019-11-24 17:59:29

标签: twilio

编辑:已解决。另一个问题-30秒后无人接听时如何播放mp3消息?

我坚持使用twilio设置。 我们需要播放mp3消息(因为twilio不支持我们的语言)。 这是实际功能(我遵循博客https://www.twilio.com/blog/2018/06/custom-javascript-twilio-functions-code-studio-flows.html上的手册)

exports.handler = function(context, event, callback) {
    // With timezone:
    // In Functions/Configure, add NPM name: moment-timezone, version: 0.5.14
    // Timezone function reference: https://momentjs.com/timezone/
    let moment = require('moment-timezone');
    //
    // timezone needed for Daylight Saving Time adjustment
    let timezone = event.timezone || 'Europe/Vienna';
    console.log("+ timezone: " + timezone);
    //
    const hour = moment().tz(timezone).format('H');
    const dayOfWeek = moment().tz(timezone).format('d');
    if ((hour >= 9 && hour < 17) && dayOfWeek <= 7) {
        // "open" from 9am to 5pm, PST.
        response = "open";
    } else {
        response = "after";
    }
    theResponse = response + " : " + hour + " " + dayOfWeek;
    console.log("+ Time request: " + theResponse);
    callback(null, theResponse);
};

我进行了功能配置,设置了矩时区版本0.5.26(但也尝试了0.5.14)和twilio 3.37.1(也是旧版本=没有成功)

这是使用的工作室流程:

enter image description here

我也尝试了这种流程,但没有成功:

enter image description here

如果我在工作时间以外拨打我们的twilio号码,它不会播放出公司留言,但会在通话前播放留言,然后连接到twilio号码。

感谢您的建议和帮助(在此处虚拟)

2 个答案:

答案 0 :(得分:0)

我发现了错误。 选中“访问控制”框,这就是为什么此流程不起作用的原因。 取消选中后,它可以工作。

这里的另一个问题-如果30秒后无人接听,我如何播放mp3消息?谢谢

图片1

答案 1 :(得分:0)

将“连接呼叫到”窗口小部件超时设置为30秒,并使用后续的“基于拆分”窗口小部件检查此“连接到”窗口小部件的DialStatus,以查看该值是否未完成,如果是,使用说/播放小部件播放.mp3。请注意启用了语音邮件的远端,该远端可能会在30秒之前接收。