I'm trying to use a TwiML moustache template for the callerId
attribute in the following Bin:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="+11234567890">
<Number>{{to}}</Number>
</Dial>
</Response>
However, when I do something like this:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId={{from}}>
<Number>{{to}}</Number>
</Dial>
</Response>
the message says that it's an invalid TwiML. The phone number in the app will be changing so I need that value to be dynamic. How would I use a template here?
Also, I've tried to set various parameters via Java like this:
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);
}
but to no avail, because the message on the Twilio dashboard always reports:
Dial: Invalid callerId value
Additionally, the two articles describing Bins didn't cover this case: link and link