Voice Quickstart Server in PHP

Overview

Programmable Voice: Quickstart Application Server - PHP

This repository contains the server-side web application required to run the Twilio Programmable Voice iOS SDK Quickstart and Android SDK Quickstart mobile sample apps.

Looking for the Quickstart mobile app?

Download the client-side Quickstart Applications in Swift and iOS here:

Download the client-side Quickstart Application for Android here:

Prerequisites

Setting up the Application

Create a configuration file for your application:

cp config.example.php config.php

Edit config.php with your Twilio credentials.

Next, we'll need to install the Twilio Helper library via Composer.

composer install

If composer install fails ensure that you have added it correctly to your path by following the instructions on Composer.

Now we should be all set! Run the application using the php -S command.

php -S 127.0.0.1:3000

Visit http://localhost:3000 to ensure the server is running.

Up and running

This web application needs to be accessbile on the public internet in order to receive webhook requests from Twilio. Ngrok is a great options for getting this done quickly.

Once you have the application running locally, in a separate terminal window, make your server available to the public internet with the following:

ngrok http 3000

You should see a dynamically generated public Ngrok URL in the command window. Ngrok will now tunnel all HTTP traffic directed at this URL to your local machine at port 3000.

Test the app

Test your app by opening the {YOUR_SERVER_URL}/accessToken.php endpoint in your browser. Use the publicly accessible domain on ngrok. You should see a long string. This is an Access Token. You can examine its contents by pasting it into a JWT tool like jwt.io.

License

MIT

Comments
  • makeCall issue

    makeCall issue

    public function makeCall(Request $request){ $callerId = 'client:quick_start'; $to = isset($_POST["to"]) ? $_POST["to"] : ""; if (!isset($to) || empty($to)) { $to = isset($_GET["to"]) ? $_GET["to"] : ""; }

        /*
        * Use a valid Twilio number by adding to your account via https://www.twilio.com/console/phone-numbers/verified
        */
        $callerNumber = '1234567890';
    
        $response = new TwiML();
        if (!isset($to) || empty($to)) {
        $response->say('Congratulations! You have just made your first call! Good bye.');
        } else if (is_numeric($to)) {
        $dial = $response->dial(
            array(
            'callerId' => $callerNumber
            ));
        $dial->number($to);
        } else {
        $dial = $response->dial(
            array(
            'callerId' => $callerId
            ));
        $dial->client($to);
        }
    
        return $response;
    }
    

    I am getting error.

    opened by santanushyamal 16
  • makeCall.php returns HTTP ERROR 500

    makeCall.php returns HTTP ERROR 500

    Hello,

    We want to integrate Programmable Voice in our Android & iOS Applications.

    Downloaded Twilio Voice Quickstart for Android and followed all the steps mentioned in readme. At the server side we are using php and trying to configure server setup by following steps mentioned in voice-quickstart-server-php. After configuring this we are trying to make a call using makeCall.php, it gives HTTP ERROR 500. We did not modify any code in this file. We just modify the requested data such as KEY_SECRET, API_KEY.

    opened by shashi-patel 12
  • Voice Call Not Working using Android SDK

    Voice Call Not Working using Android SDK

    I'm using android SDK to program voice to voice call using internet with the help of sample demo. Here are the steps that I have followed

    1. Generate Access token using identity on two different devices with two different identities as "Mit12" and "Mit13"
    2. Tap on Call Icon and input either of identity.

    Both the steps works but i never get call on either of devices.

    I have also set TwiML code on our server using PHP example and there is no error but it doesn't work. If i input phoneNumber instead of "Mit13" i get phone call not internet call.

    Please suggest what should be corrected to resolve the problem.

    opened by meet2011 9
  • Second starts when call connects but it should when call is received

    Second starts when call connects but it should when call is received

    When call connects or ringing twilio shows second. Even when ends the call after receiving twilio sends duration in callback from when call connects. But it should when call is received.

    opened by hbrawnak 2
  • didReceiveIncomingPushWith no called

    didReceiveIncomingPushWith no called

    I am using Twilio Voice Version: 6.0.0 on iOS 14. I have set up the server and app according to the steps provided in this link https://www.twilio.com/docs/voice/voip-sdk/ios/get-started

    pushRegistry:didUpdatePushCredentials:forType: is getting called as well as calling functions are working but not receiving the incoming call i.e. didReceiveIncomingPushWith is not called.

    VOIP certificate is created as well info regarding key and certificate is also updated on the console. I followed each and every step given in the guidelines but still no notification for the call though I am getting logs for the voice calls in the console. Kindly let me know if I am missing anything or I need to do some additional coding to get it working apart from the given steps in the docs.

    opened by ggurikalsi 0
  • Missing caller Id in response.

    Missing caller Id in response.

    Hello, I have faced an issue in placing a call. I have mentioned the images as you see. in the XML response, caller Id is missing. can you please help me out to send dynamic caller id instead of client:quickstart. However we are successfully able to place call but we are unable to put caller Id in the MakeCall API this is why the call is going on every phone.

    image (1) image

    opened by Prabhat-Techstriker 1
  • Can  me get this variabe  By the user

    Can me get this variabe By the user

    Can me get this variabe By the user entered in user interface $ACCOUNT_SID = 'AC***'; $API_KEY = 'SK***'; $API_KEY_SECRET = '**'; $PUSH_CREDENTIAL_SID = 'CR***'; $APP_SID = 'AP

    opened by WaseemNajib 1
  • Incoming Call to Client Issue

    Incoming Call to Client Issue

    I am using placeCall.php for inbound calls to connect to android client, but I am not getting Incoming Call notification. Following are the things that I have done to ensure everything should be fine, what am I missing:

    • When starting android application, I am generating the accessToken with identity 'xyz'.
    • Used the correct google-services.json file because I can send messages through firebase and they are coming in notification tray.
    • Used the correct server key in Push Credentials Configuration in Twilio for FCM.

    Still unable to receive any notification. How to debug why is it not connecting to FCM?

    Thanks

    opened by masoodanwar85 0
  • Voice call not working using Laravel

    Voice call not working using Laravel

    I have created functions for calling like generateAccessToken, makeCall, placeCall, incomingCall in my controllers. And I have also created public URL using ngrok and have registered on TwiML. But when I make a call from android twillio SDK ( implementation 'com.twilio:voice-android:2.0.4') only makeCall is hit and no other functions are called which lead to immediate disconnection of the active call on the android side. screenshot screenshot1

    opened by mwshubham 10
Owner
Twilio
Twilio
PHP with PDO (PHP Data Objects) Quickstart

PHP with PDO (PHP Data Objects) Quickstart This repository contains a simple web application that demonstrates how to quickly connect to and communica

Developer Code Central 3 Oct 20, 2022
Making phone calls with PHP and Twilio Voice Service.

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/P

Philipe  Lima 2 Nov 15, 2022
Php-rpc-server - JSON RPC server implementation for PHP.

JSON RPC Server implementation for PHP. The json-rpc is a very simple protocol. You can see this by reading the protocol specification. This library i

null 4 Sep 28, 2022
For server-to-server comms from PHP to CloudKit.

CloudKit-PHP Today I found this fantastic gist by Mauricevb that demonstrates how to communicate with CloudKit from PHP. I already had a previous proj

Tim Oliver 1 Oct 14, 2021
Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)

COPS COPS stands for Calibre OPDS (and HTML) Php Server. See : COPS's home for more details. Don't forget to check the Wiki. Why ? In my opinion Calib

Sébastien Lucas 1.3k Jan 1, 2023
This project processes a small database with php all on a web server. This project uses XAMPP to run the web server and the database.

PHP-introduction This project processes a small database with php all on a web server. This project uses XAMPP to run the web server and the database.

Tyler Jacques 1 Jan 6, 2022
A plugin that allows you to hear the sound "Welcome to the server!" when you join the server by NhanAZ for PocketMine-MP

General A plugin that allows you to hear the sound "Welcome to the server!" when you join the server by NhanAZ for PocketMine-MP Contacts You can cont

NhanAZ's PocketMine-MP Plugins 10 Sep 27, 2022
EXT:server-timing adds Server-Timing Header with usefull information

EXT:server_timing - see your performance installation composer require kanti/server-timing at the moment there is nothing to configure Server timings

Matthias Vogel 4 Oct 26, 2022
A Simplistic Plugin to Implement Server Claims to your Minecraft: Bedrock Server.

Claims This plugin allows administrators to create, edit, list, and teleport to land claims on a PocketMine server. These claims have a variety of cus

Santana 5 Jun 10, 2023
A multithreaded application server for PHP, written in PHP.

appserver.io, a PHP application server This is the main repository for the appserver.io project. What is appserver.io appserver.io is a multithreaded

appserver.io 951 Dec 25, 2022
A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

Felix Becker 1.1k Jan 4, 2023
A server software for Minecraft: Bedrock Edition in PHP

A highly customisable, open source server software for Minecraft: Bedrock Edition written in PHP Getting started Documentation Installation instructio

PMMP 3k Dec 31, 2022
Simple game server with php without socket programming. Uses the Api request post(json).

QMA server Simple game server with php without socket programming. Uses the Api request post(json). What does this code do? Register the user as a gue

reza malekpour 3 Sep 4, 2021
⚙️ Web3 PHP CLI is a blazing fast blockchain server for local development.

Web3 PHP CLI is a blazing fast blockchain server for local development. This project is a work-in-progress. Code and documentation are currently under

Web3 PHP 139 Jan 6, 2023
Run PHP scripts on the fly at runtime on a PocketMine-MP server (useful for debugging)

Scripter Run PHP scripts on the fly at runtime on a PocketMine-MP server. This is useful for runtime debugging, when you don't want to restart the ser

Dylan's PocketMine-MP Plugins 15 Jul 28, 2022
Minimalistic bookmark manager for your own server written in PHP. Bookmarks are stored in a sqlite database.

b - Bookmark manager b is a minimalistic bookmark manager for your own server. Written in PHP. Bookmarks are stored in a sqlite database. Features: fi

Sebastian Volland 48 Jan 6, 2023
An open-source Minecraft: Java Edition server implementation, written in PHP.

PHPCraft An open-source Minecraft: Java Edition server implementation, written in PHP. What is PHPCraft? PHPCraft is an open-source Minecraft: Java Ed

Karen/あけみ 17 Dec 31, 2022
It allows frontend developer to send ajax requests and return a custom information from the server without a php developer help

[Magento 1 Extension] It allows frontend developer to send ajax requests and return a custom information from the server without a php developer help (without any php code).

Vladimir Fishchenko 62 Apr 1, 2022
Auto RELOAD dan "live server" untuk PHP file

PHP BrowserSync Auto Reload your Browser and PHP file ini adalah auto reload php file atau browser, jika ada perubahan di file php atau di file js dan

Reza Ola 2 Jan 14, 2022