我正在用Java编写一个应用程序,它通过Twilio将电话呼叫连接到Watson Voice Agent和我的用户,我需要将一些信息传递给Voice Agent并使其可供助理使用。我正在传递sip invite标头上的信息,但我无法获得助理对话框上的信息。我的Twilio call类:
public String callPhone(String to, String from,String data)throws URISyntaxException{
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
Call call = Call.creator(
new com.twilio.type.PhoneNumber(to),
new com.twilio.type.PhoneNumber(from),
new URI("https://handler.twilio.com/twiml/xxxx?data_sent="+data))
.create();
return call.getSid();
}我的TwinML Bin代码:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Sip>sip:{{From}}@us-south.voiceagent.cloud.ibm.com?X-data={{data_sent}}</Sip>
</Dial\>
</Response>在我的语音代理配置中,我将"Custom SIP INVITE header“设置为"data”(不带引号),并在助手中尝试访问$vgwSIPCustomInviteHeader,但语音代理不会在应该显示该值的位置显示任何内容。
发布于 2019-10-31 20:54:22
我已经解决了这个问题,由于某种原因,如果我将header参数与"_“一起使用,TwinML Bin似乎不能正确地发送值,我将参数改为"dataSent”,现在它工作得很好。
https://stackoverflow.com/questions/58627001
复制相似问题