Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

TwilioDevEd/warm-transfer-servlets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warm Transfer: Transfer support calls from one agent to another using Java Servlets

Java Servlet CI

Prerequisites

  1. Java 8 installed for your operative system.

  2. A Twilio account with a verified phone number. (Get a free account here.) If you are using a Twilio Trial Account, you can learn all about it here.

Run the application

  1. Clone the repository and cd into it.

  2. The application uses Gradle to manage dependencies.

  3. Copy the sample configuration file and edit it to match your configuration.

    cp .env.example .env
    

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings. You will also need a TWILIO_NUMBER, which you may find here.

  4. Configure Twilio to call your webhooks

    You will also need to configure Twilio to call your application when calls are received on your TWILIO_NUMBER. The voice URL should look something like this:

     http://9a159ccf.ngrok.io/conference/connect/client
    

    Configure Voice

  5. Run the application using Gradle Gretty plugin.

    ./gradlew appRun

    This will run the embedded Jetty application server that uses port 8080.

How to Demo

  1. Navigate to https://<ngrok_subdomain>.ngrok.io in two different browser tabs or windows.

    Notes:

    • Remember to use your SSL enabled ngrok URL https. Failing to do this won't allow you to receive incoming calls.
    • The application has been tested with Chrome and Firefox. Safari is not supported at the moment.
  2. In one window/tab click Connect as Agent 1 and in the other one click Connect as Agent 2. Now both agents are waiting for an incoming call.

  3. Dial your Twilio Number to start a call with Agent 1. Your TWILIO_NUMBER environment variable was set when configuring the application to run.

  4. When Agent 1 answers the call from the client, he/she can dial Agent 2 in by clicking on the Dial agent 2 in button.

  5. Once Agent 2 answers the call all three participants will have joined the same call. After that, Agent 1 can drop the call and leave both the client and Agent 2 having a pleasant talk.

Dependencies

This application uses this Twilio helper library.

Run the tests

Run at the top-level directory.

./gradlew test

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.