vonage apps create 'Your application'
✅ Creating Application
Saving private key ... Done!
Application created
Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set
Capabilities:
None Enabled
Configure your prerequisites
There are a few prerequisites that you need to complete before you can work through this tutorial. If you've already completed any of them, feel free to skip that step.
You can create a Vonage account via the Dashboard.
Within the Dashboard you can create Applications and purchase Vonage numbers. You can also perform these tasks using the Vonage CLI.
Follow the steps outlined on the Getting Started with Vonage CLI page to install and configure the command line.
You must make your webhook accessible to Vonage’s APIs over the public Internet. A straightforward way to achieve this during development without standing up your own server is to use Ngrok. To learn more, read our documentation on Ngrok.
Download and install ngrok, then execute the following command to expose your application on port 3000 to the public Internet:
If you are a paid subscriber you could type:
NOTE: In this example Ngrok will divert the Vonage webhooks you specified when you created your Vonage application to localhost:3000. Although port 3000 is shown here, you can use any free port that is convenient.
There are two methods for creating a Voice application:
- Using the Vonage CLI
- Using the Dashboard
Each of these methods is described in the following sections.
How to create a Voice application using the Vonage CLI
To create your application using the Vonage CLI, enter the following command into the shell replacing NGROK_HOST_NAME with the ngrok host that you got when you set up ngrok:
To create your application using the Vonage CLI, enter the following command:
vonage apps create 'Your application'
✅ Creating Application
Saving private key ... Done!
Application created
Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set
Capabilities:
None Enabled
Then add voice capabilities to your application (use the host name from ngrok in place of example.com)
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 voice `
--voice-answer-url='https://example.com/webhooks/voice/answer' `
--voice-event-url='https://example.com/webhooks/voice/event' `
--voice-fallback-url='https://example.com/webhooks/voice/fallback'
✅ Fetching Application
✅ Adding voice capability to application 00000000-0000-0000-0000-000000000000
Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set
Capabilities:
VOICE:
Uses Signed callbacks: On
Conversation TTL: 41 hours
Leg Persistence Time: 6 days
Event URL: [POST] https://example.com/webhooks/voice/event
Answer URL: [POST] https://example.com/webhooks/voice/answer
Fallback URL: [POST] https://example.com/webhooks/voice/fallback
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 voice ^
--voice-answer-url='https://example.com/webhooks/voice/answer' ^
--voice-event-url='https://example.com/webhooks/voice/event' ^
--voice-fallback-url='https://example.com/webhooks/voice/fallback'
✅ Fetching Application
✅ Adding voice capability to application 00000000-0000-0000-0000-000000000000
Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set
Capabilities:
VOICE:
Uses Signed callbacks: On
Conversation TTL: 41 hours
Leg Persistence Time: 6 days
Event URL: [POST] https://example.com/webhooks/voice/event
Answer URL: [POST] https://example.com/webhooks/voice/answer
Fallback URL: [POST] https://example.com/webhooks/voice/fallback
This command creates a Vonage Application with Voice capability. It
configures the Application with your answer and event webhook URLs and generates a private key file private.key,
which you should save in your project directory.
The command returns a unique Application ID. Use this Application ID to link your Vonage virtual number to your Application by executing the following:
vonage apps numbers link 00000000-0000-0000-0000-000000000000 16127779311
✅ Fetching Application
Fetching Owned numbers [===============================================] 1/1 100%
Number linked
Number: 16127779311
Country: 🇺🇸 United States
Type: Toll-free
Features: MMS, SMS, VOICE
Monthly Cost: Not Set
Setup Cost: Not Set
Linked Application ID: 00000000-0000-0000-0000-000000000000
Voice Callback: app
Voice Callback Value: 00000000-0000-0000-0000-000000000000
Voice Status Callback: Not Set
vonage apps numbers link 00000000-0000-0000-0000-000000000000 16127779311
✅ Fetching Application
Fetching Owned numbers [===============================================] 1/1 100%
Number linked
Number: 16127779311
Country: 🇺🇸 United States
Type: Toll-free
Features: MMS, SMS, VOICE
Monthly Cost: Not Set
Setup Cost: Not Set
Linked Application ID: 00000000-0000-0000-0000-000000000000
Voice Callback: app
Voice Callback Value: 00000000-0000-0000-0000-000000000000
Voice Status Callback: Not Set
This will link that Vonage Virtual Number to your application, which will cause all voice events occurring for that number to be routed to your designated URLs.
How to create a Voice application using the Dashboard
You can create Voice applications in the Dashboard.
To create your application using the Dashboard:
Under Applications in the Dashboard, click the Create a new application button.
Under Name, enter the Application name. Choose a name for ease of future reference.
Click the button Generate public and private key. This will create a public/private key pair and the private key will be downloaded by your browser. Save the private key that was generated.
Under Capabilities select the Voice button.
In the Answer URL box, enter the URL for your inbound calls webhook, for example,
http://example.com/webhooks/answer.In the Event URL box, enter the URL for your call status webhook, for example,
http://example.com/webhooks/events.Click the Generate new application button.
You are now taken to the next step of the Create Application procedure where you should link your Vonage number to the application.
You have now created your application.
NOTE: Before testing your application ensure that your webhooks are configured and your webhook server is running.
Play Audio into a Call with .NET
A tutorial showing you how to build an app that will play audio into a PSTN call