Chaim Friedman
Chaim Friedman

Reputation: 720

Nexmo inbound phone call features suddenly not working - code unchanged for 2 years

We have an order status system with many users (store owners). All are assigned Nexmo numbers by myself - numbers that we own - and all link to my own application which connects to our db storing all order info from all our stores. Each user publishes their phone numbers to their customers or link them up in their own VOIP systems to transfer to their assigned Nexmo number upon request. Our code will look at the number dialed ('to') and the number from the caller ID ('from') to determine what records to query from our database to the user.

This is my Laravel code. It has stopped working consistently. Some users hear nothing upon call start, others hear just the first part. Key prompts thereafter work for all users, only the initial speech and stream do not work properly. Any idea what could be wrong suddenly?

        $store = $this->st_manager->find_record_by_nexmo_num(Input::get('to'));
        $store_name = $store['store_name'];
        $from = $_GET['from'];
        $store_phone = "1" . $store['store_phone'];
       
        if ($from == $store_phone) {
            $link_to_audio = "https://example.com/press_pound_with_no_caller_id.mp3";
        } else {
            $link_to_audio = "https://example.com/press_pound_with_caller_id.mp3";
        }

            return [


                [
                    'action' => 'talk',
                    'voiceName' => 'Matthew',
                    'level' => '1',
                    'bargeIn' => 'true',
                    'text' => "Welcome to the $store_name automated order status system",
                ],
                [

                    'action' => 'stream',
                    'bargeIn' => 'true',
                    'level' => '1',
                    'streamUrl' => ["$link_to_audio"],
                ],
                [
                    'action' => 'input',
                    'bargeIn' => 'true',
                    'eventUrl' => [
                        route('main.nexmo.event') . '?from=' . Input::get('from') . '&to=' . Input::get(
                            'to'
                        )
                    ],
                    'timeOut' => 150,
                    'submitOnHash' => true,
                    'maxDigits' => 11,
                ]

            ]; ```

        

Upvotes: 1

Views: 164

Answers (1)

Chaim Friedman
Chaim Friedman

Reputation: 720

I finally nailed this issue by switching from playing mp3 recordings to regular NCCO talk instead. Apparently either the mp3s now need to be loaded fully when the call is answered, or they have become slower to load into the system or something else of this nature. I do not know why this has changed, this code has been up there for years including the mp3's (as I already indicated in my post) but this workaround which is luckily not inconvenient for me, is working.

Upvotes: 1

Related Questions