Making phone calls with PHP and Twilio Voice Service.

Overview

TwilioVoice-PHP

This is an example implementation of Twilio's phone call API.

You can clone this code to your project:

	git clone https://github.com/Philipelima/TwilioVoice-PHP.git

Requirements

  1. PHP 7.4 >
  2. Twilio/sdk ^5.0

Installing Twilio

You will need to install the Twilio SDK. Run this command on your terminal to install:

	composer require twilio/sdk 

Setting the environment variables

Add an .env file to your project root, it must contain the variables:

TWILIO_ACCOUNT_SID= #Your Twilio Account Id.
TWILIO_AUTH_TOKEN=  #Your Twilio Authetication Token.
TWILIO_NUMBER= #The number provided by twilio.

Using the code

In your code file, add the command to load the namespaces:

	use TwilioVoicePhp\Env;
	use TwilioVoicePhp\TwilioVoicePHP;

To load the environment variables use:

	$envPath = __DIR__; //the .env file path
	Env::load($envPath);

Making a phone call via Twilio Service:

	$userNumber = "#############";
	(new TwilioVoicePHP)->makeCall($userNumber);

For more information:

Twilio Doc's: https://www.twilio.com/docs/libraries/php

Twilio Github: https://github.com/twilio/twilio-php

You might also like...
A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products.
A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products.

A high-performance license server system service for creating and managing products, major versions, and software licenses for the purpose of selling installable software products. Comes with a SDK and command-line tool. Works anywhere that PHP runs.

Ecotone Framework is Service Bus Implementation. It enables message driven architecture and DDD, CQRS, Event Sourcing PHP
Ecotone Framework is Service Bus Implementation. It enables message driven architecture and DDD, CQRS, Event Sourcing PHP

This is Read Only Repository To contribute make use of Ecotone-Dev repository. Ecotone is Service Bus Implementation, which enables message driven arc

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers

Magento 2 SMTP Extension - Gmail, G Suite, Amazon SES, Office 365, Mailgun, SendGrid, Mandrill and other SMTP servers. For Magento 2.0.x, 2.1.x, 2.2.x

Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serialization, etc to the Dubbo service framework.

Dubbox now means Dubbo eXtensions. If you know java, javax and dubbo, you know what dubbox is :) Dubbox adds features like RESTful remoting, Kyro/FST

A fully-managed real-time messaging service that allows you to send and receive messages between independent applications.

A fully-managed real-time messaging service that allows you to send and receive messages between independent applications.

Create a web service for discussion and comments of articles.

Test technique But Créer un service web de discussion et de commentaires d’articles. Fonctionnalités Les fonctionnalités attendus sont les suivantes :

MOFHY Lite is a priceless MyOwnFreeHost Client Area for account management, ticket support system and a free ssl service

MOFHY Lite is a priceless MyOwnFreeHost Client Area for account management, ticket support system and a free ssl service. It has easy to use features much like the WHMCS Digit UI interface.

This tools helps you with Collectors in DependecyInjection, Console shortcuts, ParameterProvider as service and many more.

Package Builder This tools helps you with Collectors in DependecyInjection, Console shortcuts, ParameterProvider as service and many more. Install com

LendCash is a cash lending service that lets you take loans against your stocks portfolio value and pay back on a prorated basis.

LendCash is a cash lending service that lets you take loans against your stocks portfolio value and pay back on a prorated basis.

Owner
Philipe Lima
Philipe  Lima
Voice Quickstart Server in PHP

Programmable Voice: Quickstart Application Server - PHP This repository contains the server-side web application required to run the Twilio Programmab

Twilio 8 Mar 29, 2020
Easily decorate your method calls with laravel-decorator package

?? Laravel Decorator Decorator pattern in laravel apps Made with ❤️ for smart clean coders A try to port "decorator" feature from python language to l

Iman 126 Jan 1, 2023
Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

THE TARS FOUNDATION PROJECTS 9.6k Jan 1, 2023
Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number of items.

Repeater Easy Sort Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number o

Robin Sallis 3 Oct 10, 2021
Naive Bayes works by looking at a training set and making a guess based on that set.

Naive Bayes Naive Bayes works by looking at a training set and making a guess based on that set. It uses simple statistics and a bit of math to calcul

Assisted Mindfulness 29 Nov 27, 2022
Helpers for making PHP enums more lovable.

Enums A collection of enum helpers for PHP. InvokableCases Names Values Options From Metadata You can read more about the idea on Twitter. I originall

ARCHTECH 212 Dec 22, 2022
Contains a few tools usefull for making your test-expectations agnostic to operating system specifics

PHPUnit Tools to ease cross operating system Testing make assertEquals* comparisons end-of-line (aka PHP_EOL) character agnostic Make use of EolAgnost

Markus Staab 1 Jan 3, 2022
Preload your sweet sweet code to opcache with a composer command, making your code faster to run.

Composer Preload Preload your sweet sweet code to opcache with a composer command, making your code run faster. Composer Preload is a composer plugin

Ayesh Karunaratne 197 Dec 6, 2022
Integrate reCAPTCHA using async HTTP/2, making your app fast with a few lines.

ReCaptcha Integrate reCAPTCHA using async HTTP/2, making your app fast with a few lines. use Illuminate\Support\Facades\Route; Route::post('login', f

Laragear 14 Dec 6, 2022
It is an open-source and free project, which is faced with the drawing lovers, providing a free and simple Gallery service

It is an open-source and free project, which is faced with the drawing lovers, providing a free and simple Gallery service

WeepingDogel 5 Dec 15, 2022