This repository has been archived by the owner. It is now read-only.
👋 Hi! This app is outdated and uses an old version of WebRTC.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
static
vendor
.htaccess
CHANGELOG
CODE_OF_CONDUCT.md
CONTRIBUTING.md
ISSUE_TEMPLATE.md
LICENSE
PULLREQUEST.md
PULL_REQUEST_TEMPLATE.md
Procfile
README.md
TODO
application.json
bandwidth_sip_app_apache.conf
bandwidth_sip_app_nginx.conf
callback.php
calldemo.html
calldemo.php
composer.json
composer.lock
config.php
credentials.json
helpers.php
index.html
index.php
start.php
users.json

README.md

Bandwidth SIP Call registration

⚠️ Bandwidth is no longer Supporting WebRTC per rtcpMuxPolicy until further notice. Some older browsers may still work.

This application implements 2 way SIP-PSTN call flow (using PHP catapult)

What you will need:

  1. A Bandwidth Catapult account
  2. SIP domains enabled on your account

Steps:

This application on success will create a user, domain and endpoint. Afterwards listen to incoming and outgoing calls, using AnswerCallEvent and IncomingCallEvent, when the calls are both found it will bridge into one call

Instructions / Howto:

Setting It Up:

To set the SIP call processor up, you will need to:

git clone https://github.com/BandwidthExamples/php-voice-reference-app.git

update credentials.json with your own Bandwidth User Id, Token API Key and secret, found in your catapult account settings:

Next:

check its running properly via:

php ./start.php

if all is well you should get:

"Thanks you can use the SIP Call Processing application"

Deploying

Once you've inputted your credentials, you can deploy the application, below are some instructions

Heroku

you can deploy this on heroku using the attached procfile,

commands:

heroku create "my-sip-application"

{add and commit} git push heroku master

Your application should now be viewable as my-sip-applicaiton.herokuapp.com

How to use

Before using you will need to create a user, which can be done as follows:

curl -H "Content-Type: application/json" -d '{"userName": "aUsername", "password": "aPassword" }' http://{server_url}/users

if all goes well you will receive a json response with your newly created user

Using this application can be done two ways:

Inbound: initiate a call to your Catapult number using an outside PSTN number Outbound: initiate a call using your SIP endpoint to an outside PSTN number

Other Notes

  • username can be created once, subsequent requests with the same username and different password will result in an error

  • this application will create an application for each user under the namespace, "SIP Client Application [username]"

  • this application will only use one domain