Maria is an entrepreneur, owns a Flower Shop and wants to improve Customer Support. She decided to have a Call Center that automatically answers common questions and if the customer really needs help, it transfers the call to her number.
For this challenge, you'll need to setup your environment with the following set of tools:
- Install Git
- Install Java 8
- Install Gradle
- Install Heroku CLI
- Install Ngrok
- Install cURL. This is optional but will help you testing the application HTTP endpoints without having to perform actual calls. As an alternative, you can use a GUI based application such as Postman for the same effect.
It's highly recommended that you use a Java IDE such as Intellij IDEA (Community), Eclipse, or NetBeans (Java SE).
Once git is installed on your computer you may clone this repository,
git clone https://github.com/Talkdesk/call-center-challenge-skeleton.git
and create a local branch for development.
git checkout -b <branch-name>
Please follow the convention isep-challenge-group-<group-number> when naming your branch.
You'll use Twilio as communication provider, so you need to setup an account in order to forward calls to your web application. The following steps will guide you into this.
- Sign up for a trial account.
- Let them know you're a human.
- Name your project (e.g. Talkdesk Maria Call Center).
- Your trial account is now set with a budget of $15.50.
- Under Programmable Voice, choose Numbers.
- Click the Get a Number button.
- Twilio will suggest you a Portuguese phone number. Don't accept it and search for a US number instead (by clicking on the link "Search for a different number"), as you'll be able to make free calls from Google Hangouts.
- Choose any number from the list that is presented to you.
And you're set. Click "Manage Numbers" and you'll see your brand new phone number listed. You can try it out by making a test call (use Google Hangouts for instance)
For now we're done with Twilio. We'll get back here later to hook your web application to the number you just bought.
Before starting the application, you'll need to set Maria's phone number. Note that this is the number that will be called if the customer feels like the automatic answers aren't enough to solve his problem. Just set the environment variable AGENT_NUMBER with your number:
Linux/macOS
export AGENT_NUMBER=+351XXXXXXXXX
Windows
set AGENT_NUMBER=+351XXXXXXXXX
Booting the application is as simple as running the Gradle task bootRun.
gradle bootRun
The previous command will compile and package the project and deploys it in a bundled tomcat listening on port 8080. In the end of the process, you should see a message similar to:
com.mariadesk.Application: Started Application in 9.61 seconds (JVM running for 10.149)
You can verify that the application is running as expected by making a HTTP request to the /voice/inbound endpoint.
curl -v -X POST http://localhost:8080/voice/inbound?To=test&From=test&Caller=test&CallSid=test&AccountSid=test
The service is expected to respond with status code 200
.
Finally, create a tunnel so that your local application can be accessed from the internet
ngrok http 8080
Intellij is shipped with Gradle support, so you'll just need to import the project:
-
Go to "File" > "Import project" and select the project's base directory.
-
Mark "Import project from external model" and select "Gradle". If you need additional help, check the official documentation
-
Keep the suggested settings and click "Finish".
-
All dependencies are resolved automatically.
-
You can boot the application directly from Intellij. In the "Gradle Projects" you'll find the application > bootRun task; if you double click it, the task runs and the application starts.
-
Make sure you have Buildship plugins installed in Eclipse. If you've downloaded Eclipse recently this should be bundled already.
-
Import the project as described here
-
All dependencies are resolved automatically, so the project should present zero errors.
-
You can boot the application directly from Eclipse. In the "Gradle Tasks" view you'll find the application > bootRun task; if you double click it, the task runs and the application starts.
- Install the Gradle Support.
- Select "Open Project" under "File" and import the directory where you cloned this repository to.
- All dependencies are resolved automatically, so the project should present zero errors.
- You can boot the application directly from NetBeans. Right click the project name and run the bootRun task.
- In your twilio account, access the list of "Phone Numbers".
- Click on the phone number you've just provisioned.
- In the "Voice & Fax" section configure the "A call comes in" Webhook to point to your local application (through the ngrok tunnel). The endpoint must be set as
https://<ngrok_url>/voice/inbound
where ngrok_url should be replaced by the Url that was assigned by ngrok. Example: https://44a1dcb5.ngrok.io/voice/inbound - Save the settings and make a test call.