All Projects → totalvoice → totalvoice-php

totalvoice / totalvoice-php

Licence: MIT License
Client em PHP para API da Totalvoice

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to totalvoice-php

totalvoice-node
Client em NodeJS para API da Totalvoice
Stars: ✭ 54 (+80%)
Mutual labels:  sms, tts, totalvoice, ramais
ohd
Garage Door Monitor (OverHeadDoor) - Python3, Raspbian
Stars: ✭ 126 (+320%)
Mutual labels:  sms
AiVoice
Deep CNN networks for Speech Synthesis
Stars: ✭ 45 (+50%)
Mutual labels:  tts
helios
A Java-based Sega Mega Drive/Genesis emulator. And other systems too.
Stars: ✭ 14 (-53.33%)
Mutual labels:  sms
woapp
web模拟安卓操作系统,php开发,内置文件管理,电话,短信,拍照,用在树莓派上可做智能家居,视频监控,机顶盒等……
Stars: ✭ 22 (-26.67%)
Mutual labels:  sms
dctts-pytorch
The pytorch implementation of DC-TTS
Stars: ✭ 73 (+143.33%)
Mutual labels:  tts
tts dataset maker
A gui to help make a text to speech dataset.
Stars: ✭ 20 (-33.33%)
Mutual labels:  tts
RomanceBreaker
Python script which sends a custom morning message to your significant other every morning at a given time range on Facebook Messenger, WhatsApp, Telegram or SMS, for lazy people
Stars: ✭ 36 (+20%)
Mutual labels:  sms
kavenegar-php
Kavenegar API Client Writen In PHP
Stars: ✭ 45 (+50%)
Mutual labels:  sms
openctp
CTP开放平台提供A股、港股、美股、期货、期权等全品种接入通道,通过提供中泰证券XTP、华鑫证券奇点、东方证券OST、东方财富证券EMT、盈透证券TWS等各通道的CTPAPI接口,CTP程序可以无缝对接各股票柜台。平台也提供了一套基于TTS交易系统的模拟环境,同样提供了CTPAPI兼容接口,可以替代Simnow,为CTP量化交易开发者提供7x24可用的模拟环境。
Stars: ✭ 389 (+1196.67%)
Mutual labels:  tts
security-code
A powerful security code input supports dynamic configuration of the number of input boxes.
Stars: ✭ 63 (+110%)
Mutual labels:  sms
LaravelSms
package for send sms with laravel (All gatways in Iran)
Stars: ✭ 14 (-53.33%)
Mutual labels:  sms
text-to-speech
⚡️ Capacitor plugin for synthesizing speech from text.
Stars: ✭ 50 (+66.67%)
Mutual labels:  tts
spoken-word
Spoken Word
Stars: ✭ 46 (+53.33%)
Mutual labels:  tts
pygtrans
谷歌翻译, 支持 APIKEY 一口气翻译十万条
Stars: ✭ 60 (+100%)
Mutual labels:  tts
android-messages-desktop
Android Messages as a Cross-platform Desktop App
Stars: ✭ 144 (+380%)
Mutual labels:  sms
Parallel-Tacotron2
PyTorch Implementation of Google's Parallel Tacotron 2: A Non-Autoregressive Neural TTS Model with Differentiable Duration Modeling
Stars: ✭ 149 (+396.67%)
Mutual labels:  tts
actions-sms
Send an SMS through GitHub Actions
Stars: ✭ 108 (+260%)
Mutual labels:  sms
LVCNet
LVCNet: Efficient Condition-Dependent Modeling Network for Waveform Generation
Stars: ✭ 67 (+123.33%)
Mutual labels:  tts
ucp
UCP protocol in Go
Stars: ✭ 40 (+33.33%)
Mutual labels:  sms

totalvoice-php

Cliente em PHP para API da Totalvoice

Build Status Packagist

Funcionalidades

  • Gerenciamento das chamadas
  • Consulta e envio de SMS
  • Consulta e envio de TTS
  • Consulta e envio de Audio
  • Consulta e envio de Composto
  • Consulta e envio de Conferência
  • Gerenciamento da Conta
  • Gerenciamento da Central
  • Gerenciamento de DID

Requisitos

  • PHP 5.5+
  • Autoloader compatível com a PSR-4
  • PHP deve estar compilado com a lib-curl

Instalação

Para instalar a biblioteca basta adicioná-la via composer

composer require total-voice/php-client 1.*

Ou no composer.json

{
    "total-voice/php-client": "1.*"
}

Testes

Podemos usar o composer para rodar os testes:

composer test

ou utilizando o .phar

php composer.phar test

Utilização

Para utilizar esta biblioteca, primeiramente você deverá realizar um cadastro no site da Total Voice. Após a criação do cadastro será disponibilizado um AccessToken para acesso a API.

Com o AccessToken em mãos será possível realizar as consultas/cadastros conforme documentação da API

Os métodos da API que poderão ser invocados:

  • audio
  • central
  • chamada
  • composto
  • conferencia
  • conta
  • perfil
  • sms
  • tts

A seguir um pequeno exemplo de como pode ser utilizada esta biblioteca.

Realiza uma chamada telefônica entre dois números: A e B
<?php
// Consideramos que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->chamada->ligar('NUMERO-A', 'NUMERO-B');

echo $response->getContent();
Consulta de chamada pelo ID
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->chamada->buscaChamada('ID_CHAMADA');

echo $response->getContent(); // {}
Encerra uma chamada ativa
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->chamada->encerrar('ID_CHAMADA');

echo $response->getContent(); // {}
Envio de SMS
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->sms->enviar('NUMERO-DESTINO', 'SUA MENSAGEM');

echo $response->getContent(); // {}
    
Envio de TTS
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->tts->enviar('NUMERO-DESTINO', 'SUA MENSAGEM');

echo $response->getContent(); // {}
    
Envio de Audio
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->audio->enviar('NUMERO-DESTINO', 'SUA MENSAGEM');

echo $response->getContent(); // {}
Configurações de central telefonica
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;
    
$client = new TotalVoiceClient('access-token');
$response = $client->central->buscaRamal('ID-RAMAL');

echo $response->getContent(); // {}
    
Gerenciamento dos dados da Conta
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->conta->buscaConta('ID_CONTA');

echo $response->getContent(); // {}
Consulta saldo da Minha Conta
<?php
// Considero que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;

$client = new TotalVoiceClient('access-token');
$response = $client->perfil->consultaSaldo();

echo $response->getContent(); // {}
Todas as classes da API podem ser instânciadas separadamente também
<?php
// Consideramos que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token');
$service = new Chamada($client);
$response = $service->ligar('NUMERO-A', 'NUMERO-B');

echo $response->getContent();
Caso você utilize um Client personalizado
<?php
// Consideramos que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Api\Chamada;

class MeuClient implements ClientInterface 
{

}

$meuclient = new MeuClient('access-token');
$service = new Chamada($meuclient);
$response = $service->ligar('NUMERO-A', 'NUMERO-B');
Caso você necessite utilizar seu próprio endereço configurado na Total Voice
<?php
// Consideramos que já existe um autoloader compatível com a PSR-4 registrado

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token', 'https://meuhost.com.br');
$service = new Chamada($client);
$response = $service->ligar('NUMERO-A', 'NUMERO-B');

Listando dids no estoque

<?php

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token');
$response = $client->did->listaEstoque();

Adquirindo um did

<?php

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token');
$idDid = "10";
$response = $client->did->adquirir($idDid);

Editando um did

<?php

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token');
$didId = "11";
$uraId = null;
$response = $client->did->atualizar($idDid, $ramalId, $uraId);

Deletando um did

<?php

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token');
$didId = "11";
$response = $client->did->excluir($didId);

Listando seus dids

<?php

use TotalVoice\Client as TotalVoiceClient;
use TotalVoice\Api\Chamada;

$client = new TotalVoiceClient('access-token');
$response = $client->did->lista();

Mais informações sobre os métodos disponíveis podem ser encontrados na documentação da API

Contribua!

Quer contribuir? clique aqui

Licença

Esta biblioteca segue os termos de uso da MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].