Skip to content

Bandwidth-Samples/voice-bridge-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voice-Bridge-PHP

Table of Contents

Description

A simple PHP sample application demonstrating how to bridge two live calls using the Bandwidth V2 Voice API.

Bandwidth

In order to use the Bandwidth API users need to set up the appropriate application at the Bandwidth Dashboard and create API credentials.

To create an application log into the Bandwidth Dashboard and navigate to the Applications tab. Fill out the New Application form selecting the service (Messaging or Voice) that the application will be used for. All Bandwidth services require publicly accessible Callback URLs, for more information on how to set one up see Callback URLs.

For more information about API credentials see here

Environmental Variables

The sample app uses the below environmental variables.

BW_ACCOUNT_ID                 # Your Bandwidth Account Id
BW_USERNAME                   # Your Bandwidth API Username
BW_PASSWORD                   # Your Bandwidth API Password
BW_VOICE_APPLICATION_ID       # Your Voice Application Id created in the dashboard
BW_MESSAGING_APPLICATION_ID   # Your Messaging Application Id created in the dashboard
BASE_CALLBACK_URL             # Your public base url
USER_NUMBER                   # The number dialed out to when an inbound call is received on your Bandwidth number

Callback URLs

For a detailed introduction to Bandwidth Callbacks see https://dev.bandwidth.com/guides/callbacks/callbacks.html

Below are the callback paths:

  • /callbacks/inboundCall
  • /callbacks/outboundCall

Ngrok

A simple way to set up a local callback URL for testing is to use the free tool ngrok.
After you have downloaded and installed ngrok run the following command to open a public tunnel to your port ($LOCAL_PORT)

ngrok http $LOCAL_PORT

You can view your public URL at http://127.0.0.1:{LOCAL_PORT} after ngrok is running. You can also view the status of the tunnel and requests/responses here.

About

Bridge voice calls using our PHP SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages