Слишком большое тело ответа TwiML Ошибка 11750 laravel - PullRequest
1 голос
/ 14 апреля 2020
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Twilio\Rest\Client;
use Twilio\TwiML\VoiceResponse;

class HomeController extends Controller
{
// call process
    public function welcome(Request $request)
    {
        $twiml = new VoiceResponse();
        if(isset($request->Digits)){
            switch($request->Digits){
                case 1:
                    $twiml->say('thank you calling us');
                    break;
                default:
                    $twiml->say('You have entered wrong key');
                    break;
            }
        } else{
            $twiml->say(
                'Thank you for calling Call Congress! Press 1 for Connect the call.'
            )->gather([
                'numDigits' => 1,
                'action' => $this->endCall();
            ]);
            /*$gather = $twiml->gather(array('numDigits' => 1));
            $gather->say('Thank you for calling us. Press 1 to continue the call.');*/
        }

        return $twiml;
    }

    public static function endCall()
    {
        $twiml = new Twiml();

        $twiml->say(
            'Thank you for using Call Congress! ' .
            'Your voice makes a difference. Goodbye.'
        )->hangup();

        return $twiml;
    }
}

Я получаю сообщение об ошибке: «В вашем ответе на запрос Twilio тело ответа превышает 64 кБ. ». Возможные причины Размер обслуживаемого вами TwiML превышает 64 КБ, или вы предоставляете контент, отличный от TwiML, в своем ответе. Заранее спасибо.

1 Ответ

3 голосов
/ 14 апреля 2020

Обычно это означает, что ваше приложение аварийно завершает работу и возвращает трассировку стека для выполнения Twilio, что приводит к этой ошибке.

...