【发布时间】:2020-04-14 16:35:50
【问题描述】:
我正在尝试通知排队的呼叫者他们在队列中的位置,
这是我当前的 twilio 函数,它使调用入队
let twiml = new Twilio.twiml.VoiceResponse();
twiml.say("Please hold, while we connect you to one of our available agent ");
twiml.enqueue({
workflowSid: context.WORKFLOW_SID,
})
.task({}, `{"selected_skill":"operator","name":"${event.name}","email":"${event.email}"}`);
callback(null, twiml);
so here i want to add something like twiml.say("You are now number ${number} in the queue");
};
但我被困住了。在 php 中,我像这样使用 twiml:
header("Content-type: text/xml");
$var = $_POST['QueuePosition'];
$message = '<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play>http://com.twilio.sounds.music.s3.amazonaws.com/ClockworkWaltz.mp3</Play>
<Say>You are currently in position '.$var.' in the queue.</Say>
<Queue url="about_to_connect.php">support</Queue>
</Response>';
echo $message;
它可以工作,但现在我想使用/正在使用 twilio 功能。
请帮忙
提前致谢
【问题讨论】:
标签: twilio twilio-api twilio-functions