https://github.com/nexmo/node-call-whisper
Use Call Whisper to let call center agents know the source of inbound calls
https://github.com/nexmo/node-call-whisper
nexmo nodejs tutorial voice
Last synced: 3 months ago
JSON representation
Use Call Whisper to let call center agents know the source of inbound calls
- Host: GitHub
- URL: https://github.com/nexmo/node-call-whisper
- Owner: Nexmo
- Created: 2017-02-21T14:34:53.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-04-30T03:58:52.000Z (over 1 year ago)
- Last Synced: 2024-04-30T05:19:22.628Z (over 1 year ago)
- Topics: nexmo, nodejs, tutorial, voice
- Language: JavaScript
- Homepage: https://developer.nexmo.com/tutorials/add-a-call-whisper-to-an-inbound-call
- Size: 937 KB
- Stars: 4
- Watchers: 18
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Add a Call Whisper using Node and the Nexmo Voice API
This app used the Nexmo Voice APIs to demonstrate how add a "whisper" (a spoken announcement to only one caller before connecting) to a call using the `onAnswer` feature.
## Prerequisites
You will need:
* A [free Nexmo account](https://dashboard.nexmo.com/sign-up)
* The [Nexmo CLI](https://github.com/Nexmo/nexmo-cli) installed
* A way to run a local server on a public port, for example [Ngrok](https://ngrok.com/).## Installation
```sh
git clone https://github.com/nexmo/node-call-whisper.git
cd node-call-whispher
npm install
```## Setup
### Buy Numbers & Create Application
To run this application we need to buy 2 numbers, set up an application, and tie the numbers to this application.
```sh
# create an application
> nexmo app:create "Whisper System" http://your.domain/answer_inbound http://your.domain/event --type voice --keyfile app.key
# check the application ID
> nexmo app:list
12345678-1234-1234-1234-1234567890 | Whisper System
# purchase 2 numbers
> nexmo number:buy 4420 -c GB --confirm
Number purchased: 442055555555
> nexmo number:buy 4420 -c GB --confirm
Number purchased: 442055555556
# link the numbers to the application ID
> nexmo link:app 442055555555 12345678-1234-1234-1234-1234567890
> nexmo link:app 442055555556 12345678-1234-1234-1234-1234567890
```### Run Server
The next step is to set up all of our variables in a `.env` file. You can start off by copying the example file.
```sh
mv .env.example .env
```Fill in the values in `.env` as appropriate, where `INBOUND_NUMBER_1` and `INBOUND_NUMBER_2` are the numbers you just purchased, `CALL_CENTER_NUMBER` is the number you want them to direct to, and `NEXMO_APP_FILE_NAME` is the file name of your application key (`app.key`). Finally, `DOMAIN` is the public domain or hostname your server is available on.
With this in place you can start the server.
```sh
npm start
```The application should be available on . For this to work full though, make sure to expose your server on a public domain (e.g. `your.domain` in the example above) using a tool like [Ngrok](https://ngrok.com/).
## Using the App
To use the app you need two phones, or a phone and something like Skype to make the first call.
With your server running, call either of the 2 numbers you purchased. Nexmo will then make a call to `http://your.domain/answer_inbound` which puts the inbound call on hold. A call is then made to the `CALL_CENTER_NUMBER`(your other phone) where a message is played regarding the nature of the call before both parties are connected to the same conference.
## More Information
For a more detailed writeup, see the [tutorial on the Nexmo Developer Portal](https://developer.nexmo.com/tutorials/add-a-call-whisper-to-an-inbound-call).