繁体   English   中英

Android:Nexmo通话Api不适用于IVR通话

[英]Android:Nexmo Call Api is not working for IVR call

我正在我的应用程序中实现IVR呼叫 我在公共服务器上托管的语音xml代码如下。
我已按照Nexmo网站上给出的所有步骤进行操作,甚至获得状态代码= 0表示成功,但我没有接到任何电话。 知道我误会了吗?

<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >
   <menu dtmf="true">
      <property name="inputmodes" value="dtmf"/>
      <prompt>
         For sales press 1, For support press 2.
      </prompt>
      <choice dtmf="1" next="#sales"/>
      <choice dtmf="2" next="#support"/>
      </menu>
   <form id="sales">
      <block>
      <prompt>
         Please wait while we transfer the call
      </prompt>
      </block>
         <transfer name="MyCall" dest="tel:+4400000001" bridge="true" connecttimeout="20s"/>
      </form>
      <form id="support">
      <block>
      <prompt>
         Please wait while we transfer the call
      </prompt>
      </block>
         <transfer name="MyCall" dest="tel:+4400000002" bridge="true" connecttimeout="20s"/>
   </form>
</vxml>

对于IVR呼叫,我使用了以下代码段

if(id == R.id.action_call){
            CallRequest request=new CallRequest();
            request.setApiKey(ApiConfig.NEXMO_KEY);
            request.setApiSecret(ApiConfig.NEXMO_SECRET);
            request.setTo("919582455283");
            request.setAnswerUrl(ApiConfig.ANSWER_URL);
            Toast.makeText(MainActivity.this,"Initiating call...",Toast.LENGTH_LONG).show();
            App.getRestClient().doMakeCall(new RequestCallback<CallResponse>() {
                @Override
                public void onRestResponse(Exception e, CallResponse result) {
                    if (e==null){
                        Toast.makeText(MainActivity.this,result.toString(),Toast.LENGTH_LONG).show();
                    }else {
                        Toast.makeText(MainActivity.this,e.getMessage(),Toast.LENGTH_LONG);
                    }
                }
            }, Constants.CALL_BASE_URL,request);
            return true;
        } 

在这里,我在CallResponse获得SUCCESS ,但是没有接到任何电话。

披露:我为Nexmo工作。

语音呼叫的status属性仅表示请求已成功排队(所有参数均有效,身份验证正确,等等)。

如果您在初始请求中传递了一个error_url ,您将获得一些有关为何无法接听电话的信息。 有关的文档在这里

您还可以向支持团队发送您在响应中获得的call-id ,并查看他们是否可以提供更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM