I am implementing IVR calling in my app.
My voice xml code hosted on public server is below.
I have followed all the steps given on Nexmo website , even getting status code =0 which means success, but I am not receiving any call. Any idea where I am mistaking?
<?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>
For IVR Calling i hav used following code snippet
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;
}
Here i got SUCCESS
in CallResponse
but not receiving any call.
Disclosure: I work for Nexmo.
The
status
property on a voice call just means the request was successfully queued (all the parameters were valid, the authentication was correct, etc).If you pass an
error_url
in the initial request, you'll get some information on why you're not getting the call. The docs on that are here.You can also send the support team the
call-id
you get in the response, and see if there's more information they can provide.