Остановить звонок, если он повесил трубку в Twilio через php - PullRequest
0 голосов
/ 06 августа 2020

У меня проблема с Twilio. Мне нужно остановить звонок, если кто-то из циферблатов принял звонок и повесил трубку. Если на звонок не ответили, начните воспроизведение музыки c и начните второй набор.

<?php
header('Refresh: 0');
//<Dial>
//here is first dial
//</Dial>
if ($last_call_status != 'completed') {
    //<Gather>
    $gather = $response->gather([
        'timeout' => '15',
        'action' => 'https://hook.integromat.com/2dsou78j77uwcwh15me5gfu3durqbm9c',
        'method' => 'GET'
    ]);
    $gather->play('https://pearl-drever-6934.twil.io/assets/b6d767d2f8ed5d21a44b0e5886680cb9.wav');
    //<Gather>
    //<Dial>
    //here is second dial
    //</Dial>
    echo $response;
} else {
    //here is hang up
}
...