Skip to content

biligeny/vonage-workshop

Repository files navigation

Node.js Vonage SMS and Voice sample for Google App Engine

This sample shows how to use Vonage on Google App Engine Node.js standard environment and flexible environment

For more information about Vonage, see the Vonage SDK library.

Setup

Before you can run or deploy the sample, you will need to Do The Following:

  1. Create a Vonage Account
  2. Rent a Vonage Number

Webhooks

  1. Configure the Voice Receive (https://{your-project-id}.appspot.com/call/receive) and SMS Inbound (https://{your-project-id}.appspot.com/sms/receive) Webhook - If you deploy to the GCP.

  2. See Using Ngrok for local development for details of how to set up and use Ngrok for locall environment.

Configure Environment Variables

  1. Configure your Vonage settings in the environment variables section in file app.yaml-example and rename to app.yaml.

  2. Export your Vonage settings in app.sh-example and rename to app.sh if you want run this in local development.

  3. Replace private.key-example with your applications's private.key file.

Quickstart for Node.js in the App Engine standard environment

This is the sample application for the Quickstart for Node.js in the App Engine standard environment in the App Engine documentation.

Install dependencies

npm install

Deploying to App Engine

gcloud app deploy
gcloud app browse
gcloud app logs tail -s default

Running locally

npm update
source ./app.sh
npm start

Testing the service

SMS

curl -X POST -d 'from={Sender ID}&to={To Number}&text={Message Body}' http://{host}:{port}/sms/send

Verify

curl -X POST -d 'brand={Brand Name}&to={To Number}' http://{host}:{port}/verify/start
curl -X POST -d 'id={Request ID}&code={Verify Code}' http://{host}:{port}/verify/check

Voice

curl -X POST -d 'from={From Number}&to={To Number}&text={TTS Text}' http://{host}:{port}/voice/call

Set the http://{host}:{port}/voice/receive on your VONAGE_NUMBER, call on the number to check receive.
Set the http://{host}:{port}/voice/dtmf on your VONAGE_NUMBER, call on the number to check DTMF.
Set the http://{host}:{port}/voice/asr on your VONAGE_NUMBER, call on the mumber to check ASR.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published