Contrived but short example on how to create series of browser softphones using Twilio, Twilio Client's APIs and transfer incoming PSTN calls between them.
####Requirements
This project exposes 3 different endpoints
Displays a page with a Twilio Client under the client name: <client_name>
Calls directed to the client named, <client_name> will ring the browser showing this page.
The following TwiML calls the Twilio Client on /client/alice
<Response>
<Dial>
<Client>alice</Client>
</Dial>
</Response>
Used as the Voice URL for your Twilio Number to forward all calls made to that number to the designated <client_name>
Called within a Javascript AJAX call to transfer the current call from <from_client> to <to_client>
- Clone the repository
- Edit TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN
- Added http://<server>/incoming_voice_url/alice as your phone number's Voice URL in the Twilio Dashboard
- Open 2 browser windows to http://<server>/client/alice and http://<server>/client/bob
- Call in to your Twilio number and Alice's browser phone will ring and click on the transfer to Bob button.