Skip to content

cardozotm/call-tracking-servlets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Call Tracking on Java Servlets

Build Status

Use Twilio to track the effectiveness of your different marketing campaigns. Learn how call tracking helps organizations in these Twilio customer stories.

Quickstart

Create a TwiML App

This project is configured to use a TwiML App, which allows us to easily set the voice URLs for all Twilio phone numbers we purchase in this app.

Create a new TwiML app at https://www.twilio.com/user/account/apps/add and use its Sid as the TWIML_APPLICATION_SID environment variable wherever you run this app.

Creating a TwiML App

You can learn more about TwiML apps here: https://www.twilio.com/help/faq/twilio-client/how-do-i-create-a-twiml-app

Local development

This project was built using Java Servlets.

  1. Clone this repository and cd into its directory:
git clone git@github.com:TwilioDevEd/call-tracking-servlets.git
  1. Create the database.
$ createdb call-tracking-servlets

The application uses PostgreSQL as the persistence layer. If you don't have it already, you should install it. The easiest way is by using Postgres.app.

  1. Edit the sample configuration file .environment to match your database and Twilio's configuration:

export DB_USERNAME=your_db_username export DB_PASSWORD=your_db_password export JDBC_URL=jdbc:postgresql://localhost:5432/call-tracking-servlets export TWILIO_ACCOUNT_SID=your_account_sid export TWILIO_AUTH_TOKEN=your_account_token export TWILIO_APP_SID=your_app_sid ```

Once you have edited the .environment file, if you are using a UNIX operating system, just use the source command to load the variables into your environment:

$ source .environment

If you are using a different operating system, make sure that all the variables from the .environment file are loaded into your environment.

  1. Execute the migrations.
$ ./gradlew flywayMigrate
  1. Run the application.
$ ./gradlew jettyRun
  1. Check it out at http://localhost:8080

    That's it!

Additionally, in order to let Twilio Phone numbers use the callback endpoint we exposed, our development server will need to be publicly accessible. We recommend using ngrok to solve this problem.

Meta

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

About

Call tracking demo app implemented with Java and Servlets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 73.2%
  • Java 26.5%
  • CSS 0.3%