An Open-Source PBX-Like Phone System for Twilio SIP Domains Built in node.js and Hosted on Heroku.
-
Create Twilio calls when dialed from a SIP endpoint
-
Create Twilio calls using 2 legs when dialed from an HTTP endpoint (Click2Call aka Click2Dial)
-
Display list of active calls
-
Display list of active conferences
-
Allow active calls to be transferred to another user (by moving User to Conference1, Customer to Conference2, adding User2 to Conference1, then moving User2 to Conference2)]
-
Create Hunt Group to dial User 1/2/3/etc in order. Move to next if Busy, DND or after XX seconds May be creating a node.js version of: https://github.com/philnash/useful-twilio-functions/tree/master/hunt
You will need some credentials and other information from your Twilio account. They will need to be set as environment variables on the platform that you deploy the application to. Below you will find the config variable name and where you can find it.
Key | Explanation |
---|---|
ACCOUNT_SID | The ID of your Twilio account from https://www.twilio.com/console/account/settings |
API_SID | The ID of your new API Key from https://www.twilio.com/console/runtime/api-keys |
API_SECRET | The secret for your new API Key from https://www.twilio.com/console/runtime/api-keys |
CALLER_ID | The Twilio phone number Caller ID you would like to use for the application |
SIP_DOMAIN | The SIP Domain you have set up in your Twilio account here https://www.twilio.com/console/voice/sip/endpoints |
-
Create a new application in Heroku
-
In the 'Deploy' tab in Heroku, connect to this github repo
-
In the 'Settings' tab in Heroku, set up the config variables from above
You will need the latest version of Node.js in LTS. At time of writing, this is 6.11.2.
Clone the repo:
git clone https://github.com/dev-manager-uk/twiliohoho.git
cd twiliohoho
Install the dependencies:
npm install
Copy .env.example
to .env
and fill in the config variables from above. Run the application with
npm start
-
Load the monitor pages by going to: https://YOUR-APP.herokuapp.com/calls https://YOUR-APP.herokuapp.com/conferences
-
Load the Click2Call by submitting a POST request to:
https://YOUR-APP.herokuapp.com/Click
Called: [The phone number you would like to call]
CallerID: [The caller ID for the call]
User: [The SIP user who should be connected to the external call]
-
You will need to set up a SIP domain in Twilio at: https://www.twilio.com/console/voice/sip/endpoints
-
You will need to set up SIP User Endpoints at: https://www.twilio.com/console/voice/sip/cls