Twilio - 记录一个排队的电话

时间:2016-06-13 16:04:00

标签: xml node.js twilio twiml twilio-api

我使用NodeJS用Twilio编写语音演示。使用<enqueue> verb来电将被置于如下的队列中:

String string = editText.getText().toString();
String[] parts = string.split(",");
//now just check for each part if the condition is met
foreach ( String part : parts){
    if (part.length()<10 || part.length()>15){  
        editText.setError("whatever");
        return;
    }
}
//if you get to this part, there's no error, everything went fine
//so do whatever you need if there's no error
//or simply return true

在wait.xml上,我暂停并等待第二个客户端从队列中接听电话:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Enqueue waitUrl="/wait.xml">support</Enqueue>
</Response>

启动第二个客户端时,它使用<?xml version="1.0" encoding="UTF-8" ?> <Response> <Say voice="alice">Connecting to representative</Say> <Pause length="100"/> <Leave/> </Response> 将呼叫出列:

<Dial>

除了通话记录外,所有功能都按预期工作。在调用<?xml version="1.0" encoding="UTF-8"?> <Response> <Dial record="record-from-answer" action="./record" method="GET"> <Queue>support</Queue> </Dial> </Response> 时我使用相同的原则,并且工作正常。

我错过了什么?

0 个答案:

没有答案