PHP code example of lucien-correia / total-voice

1. Go to this page and download the library: Download lucien-correia/total-voice library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lucien-correia / total-voice example snippets



  
  return [
    'token' => env('TOTAL_VOICE_TOKEN', 'TOKEN')
  ];
  


use TotalVoice\Channels\Sms\Sender;

$sender = new Sender();

$sender->phone('(99) 99999-9999')
  ->message('mensagem de texto')
  ->send();



use TotalVoice\Channels\Audio\Sender;

$sender = new Sender();

$sender->phone('(99) 99999-9999', 'caller')
  ->phone('(99) 99999-9999', 'receiver')
  ->audio('http://minhaurlcomaudio.com')
  ->tags('clientX') // Opcional
  ->recordAudio(false) // Opcional
  ->send();



use TotalVoice\Channels\Composto\Sender;

$sender = new Sender();

$sender->phone('(99) 99999-9999', 'caller')
  ->phone('(99) 99999-9999', 'receiver')
  ->audio('http://minhaurlcomaudio.com')
  ->recordAudio(false) // Opcional
  ->send();



use TotalVoice\Channels\Composto\Sender;

$sender = new Sender();

$sender->phone('(99) 99999-9999', 'caller')
  ->phone('(99) 99999-9999', 'receiver')
  ->tts('meu texto a ser lido', 'false', '-4', 'br-Ricardo') 
  ->tags('clientX') // Opcional
  ->recordAudio(false) // Opcional
  ->send();



use TotalVoice\Channels\Composto\Sender;

$sender = new Sender();

$sender->phone('(99) 99999-9999', 'caller')
  ->phone('(99) 99999-9999', 'receiver')
  ->transfer('(99) 99999-9999', '(99) 99999-9999', 1) 
  ->tags('clientX') // Opcional
  ->recordAudio(false) // Opcional
  ->send();