- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在我的 spring MVC 项目中使用 nexmo api 实现调用功能,但我不断收到以下异常
com.vonage.client.VonageResponseParseException: Unable to parse response.
at com.vonage.client.AbstractMethod.execute(AbstractMethod.java:105) ~[client-6.1.0.jar:6.1.0]
at com.vonage.client.voice.CallsEndpoint.post(CallsEndpoint.java:57) ~[client-6.1.0.jar:6.1.0]
at com.vonage.client.voice.VoiceClient.createCall(VoiceClient.java:61) ~[client-6.1.0.jar:6.1.0]
.............................
Caused by: org.apache.http.client.HttpResponseException: Bad Request
at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:69) ~[httpclient-4.5.1.jar:4.5.1]
at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:65) ~[httpclient-4.5.1.jar:4.5.1]
at com.vonage.client.voice.CreateCallMethod.parseResponse(CreateCallMethod.java:57) ~[client-6.1.0.jar:6.1.0]
at com.vonage.client.voice.CreateCallMethod.parseResponse(CreateCallMethod.java:32) ~[client-6.1.0.jar:6.1.0]
at com.vonage.client.AbstractMethod.execute(AbstractMethod.java:102) ~[client-6.1.0.jar:6.1.0]
... 51 more
下面是我的代码逻辑
VonageClient client = VonageClient.builder().applicationId(APPLICATION_ID).privateKeyContents(PRIVATE_KEY).build();
Ncco ncco = new Ncco(TalkAction.builder("message").build());
Call call = new Call(TO_NUMBER, FROM_NUMBER, ncco);
CallEvent result = client.getVoiceClient().createCall(call);
尽管入站调用可以使用下面的 curl 命令工作
curl -X POST https://api.nexmo.com/v1/calls\
-H "Authorization: Bearer "$JWT\
-H "Content-Type: application/json"\
-d '{"to":[{"type": "phone","number": "TO_NUMBER"}],
"from": {"type": "phone","number": "FROM_NUMBER"},
"ncco": [
{
"action": "talk",
"text": "This is a text to speech call from Vonage"
}
]}'
最佳答案
此处提供的代码似乎在 5.6.0 版本的 nexmo 客户端上运行良好 - 我会确保您一直是最新的。
该错误表明传递给 nexmo API 的内容是错误的,因此如果升级后这仍然是一个问题,可能值得打开一些日志记录 here's an example of how to turn on logging .这将使您能够准确地看到它传递的是什么,也许还能找出问题所在。
关于java - HttpResponseException : Bad Request occurs while implementing call inbound using vonage SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65919153/
我有一个服务器监听来自 nexmo 的 NCCO 请求。我的 nexmo 应用程序配置为将所有传入调用转发到此服务器。当为来电请求 NCCO 时,我会返回一个带有“连接”操作的 NCCO 以及一个 w
我正在为 vonage 电话在 android 中开发调用转移应用程序。如何获取用于通过 android 转接调用的 api。vonage.com在他们的网站上没有指定任何适用于 android 的
我正在尝试在我的 spring MVC 项目中使用 nexmo api 实现调用功能,但我不断收到以下异常 com.vonage.client.VonageResponseParseException
我所有相关依赖项的 pom.xml。没有其他依赖项在内部使用以下依赖项。 com.fasterxml.jackson.core jackson-databind
我是一名优秀的程序员,十分优秀!