Skip to content

Vonage-Community/sample-voice-nodejs-call-tracking

Repository files navigation

Calling Tracking Demo using Node and the Vonage Voice API

This app used the Vonage Voice API to demonstrate how a call tracking application could be built.

  • The call is tracked
  • Incoming calls are proxied to a destination number

You can read the detailed tutorial on Vonage's Developer Portal about call tracking; this repo is the sample code to accompany that tutorial.

Prerequisites

You will need:

  • At least one Vonage Virtual Number (Phone Number)
  • The Vonage CLI installed
  • Somewhere to host this web app, Heroku or Your Local Machine with ngrok both work well

Installation

git clone https://github.com/nexmo/node-call-tracker.git
cd node-call-tracker
npm install

Setup

Rename the config file:

cp .env-example .env

Fill in the values in .env as appropriate.

Edit the following command to use the URL of where your application is hosted. Then run the Vonage CLI command below and take note of the application universally unique identifier (UUID) it returns:

voange apps create demo-app

Then configure the application to use voice and send events to the application

vonage apps capabilities update voice --voice-answer-url='http://your-url-here/track-call' --voice-event-url='http://your-url-here/event'

Buy numbers for calls that you would like to track. The following example buys the first available number in a given country by country code.

vonage numbers buy --country_code [YOUR_COUNTRY_CODE]

Link each number to the application by running a command like this with the application UUID and the number to link.

voange apps numbers link [app-id] [NUMBER]

Running the App

npm start

The application should be available on http://localhost:5000.

Using the App

Call one of the virtual numbers that you rented. The call will be tracked and forwarded to the desired destination number.

You can see a list of tracked calls by accessing http://localhost:5000/tracked-calls.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5