2

I am trying to create an answering machine. I am using Nexmo.

I have two numbers : One French Number, and one US Number (California)

When I call my french number, my audio message is saved on my server and i can listen it. But when i call my US Number, I can listen my prompt (here it's ) but the audio message saved is not saved correctly. I don't know why, any idea ?

phone.php

<?php
    // accept both query string and post
    $request = array_merge($_GET, $_POST);
    error_log('got a call from: ' . $request['nexmo_caller_id']);
    // make the XML short tag friendly
    echo '<?xml version="1.0" encoding="UTF-8"?>';
    ?>
    <vxml version = "2.1">
        <form>
            <record name="message" beep="true" maxtime="60s" dtmfterm="true">
                <audio src="./welcome.wav"/>
            </record>
            <catch event="connection.disconnect.hangup">
                <submit next="./recphone.php" enctype="multipart/form-data" method="post"/>
            </catch>
        </form>
    </vxml>

recphone.php

<?php
if(!isset($_FILES['message'])){
    return; //not a post from our script
}

switch($_FILES['message']['error']){
    case UPLOAD_ERR_OK:
        move_uploaded_file($_FILES['message']['tmp_name'], './recordings/' . $_FILES['message']['name']);
        $prompt = 'Thanks, your message has been saved.';
        break;
    default:
        $prompt = 'Sorry, we could not save your message.';
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<vxml version="2.1">
    <form>
        <block>
            <prompt><?php echo $prompt ?></prompt>
        </block>
    </form>
</vxml>
Guillaume
  • 586
  • 3
  • 21

3 Answers3

0

Guillaume,

I'm not sure why it's not working, to be honest. When you say it's not saved correctly, what do you mean? Do you have a problem with the content of the audio? The codec? Or something else?

Also, when you do your tests, where do you do it from? E.g. are you calling your French number from France, and the US number from France too? If so, what's happening if calling the US number from the US itself?

Lastly, what kind of US number have you got with Nexmo? Have you checked it has all the requirements for your use case?

Olivier
  • 130
  • 2
  • 3
  • 11
  • I mean a audio file is created but it's just some noise, not the content of my message. Here is my test : 1) France to French Number : Works 2) Skype to French Number : FAIL 3) US to US Number : FAIL 4) Skype to US Number : FAIL But if i call my VoiceXML file with voxeo.com and it works... I got this number : 19093431653, it's a voice / sms number. I already sent a message to nexmo and they are investigate about my problem. – Guillaume Aug 02 '16 at 16:11
0

Are the audio volumes different on the two TFNs? Is it possible the platform is thinking audio has stopped because the volume levels drop below the detection threshold?

If the audio truncation is consistent regardless of the length of the message left, I would look towards the platform as having an inconsistent setting.

Jim Rush
  • 4,143
  • 3
  • 25
  • 27
  • Here is an example of the audio message i got for a call of 5-10 secondes : http://teillet.eu/phone/recordings/message-1470154576875.wav If the audio volumes is not the same for the two numbers on Nexmo, i think i can't do nothing except look for another provider. – Guillaume Aug 02 '16 at 16:24
0

There is a problem with Nexmo when redirects calls to a VoiceXML document.

I finally decide to use Asterisk to create my IVR.

If someone landed here with the idea of creating its IVR, I wrote a tutorial on my GitHub : https://github.com/guillaumeteillet/ivr-guillaume-teillet

Guillaume
  • 586
  • 3
  • 21