botman / botman

A framework agnostic PHP library to build chat bots
https://botman.io
MIT License
6.05k stars 811 forks source link

Twillo doesn't wait for responses and hanging up #888

Closed vittoriodev closed 5 years ago

vittoriodev commented 6 years ago

Description:

if i call my number hooked on botman the first message gets transcribed and sad by alice, but after the first message (ask or say makes no difference) the call ends.

Steps To Reproduce:

im using the botman studio for testing.

I used the Event like this:

$botman->on(TwilioVoiceDriver::INCOMING_CALL, function($payload, $bot) {
    $bot->startConversation(new \App\Conversations\PhoneCallBase);
});

My conv:

<?php

namespace App\Conversations;

use BotMan\BotMan\Messages\Conversations\Conversation;
use BotMan\BotMan\Messages\Incoming\Answer;

class PhoneCallBase extends Conversation
{

    protected $name;

    protected $email;

    public function askFirstname()
    {
        $this->say('Herzlich Willkommen!');
        $this->ask('Zunächst müsste ich wissen wie Sie heißen?', function(Answer $answer) {
            // Save result
            $this->name = $answer->getText();

            $this->say('Schön Sie kennen zu lernen '.$this->name);
            $this->askEmail();
        });
    }

    public function askEmail()
    {
        $this->ask('Und wie lautet die E-Mail an die wir uns wenden können?', function(Answer $answer) {
            // Save result
            $this->email = $answer->getText();

            $this->say('Alles klar, '.$this->name);
        });
    }

    public function run()
    {
        // This will be called immediately
        $this->askFirstname();
    }
}
vittoriodev commented 5 years ago

So sad, botman not longer maintained?