【发布时间】:2021-01-22 02:22:33
【问题描述】:
我正在尝试为以下 Bin 中的 callerId 属性使用 TwiML 小胡子模板:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="+11234567890">
<Number>{{to}}</Number>
</Dial>
</Response>
但是,当我这样做时:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId={{from}}>
<Number>{{to}}</Number>
</Dial>
</Response>
消息说它是无效的 TwiML。应用程序中的电话号码将发生变化,因此我需要该值是动态的。我将如何在这里使用模板?
另外,我尝试通过 Java 设置各种参数,如下所示:
public void makeCall() {
if (accessToken != null) {
params.put("To", toNumber);
params.put("From", "11234567890");
params.put("Caller", "11234567890");
params.put("CallerId", "client:11234567890");
ConnectOptions connectOptions = new ConnectOptions.Builder(accessToken)
.params(params)
.build();
activeCall = Voice.connect(context, connectOptions, callListener);
}
但无济于事,因为 Twilio 仪表板上的消息总是报告:
拨号:无效的 callerId 值
【问题讨论】:
标签: java xml twilio twilio-twiml