Ruby
Define Constant Variables
The Vonage Voice API sends back call information to the webhook addresses we provided in the Vonage Voice Application in the API Dashboard. To receive that data we need an externally accessible URL. This tutorial uses ngrok to provide an externally available URL. For more information on setting up ngrok, follow this tutorial.
After initializing the Vonage Ruby SDK client in the server.rb file, add the following two constant variables, making sure to replace the sample ngrok URL in the BASE_URL constant definition with your own:
BASE_URL = 'https://sample-change-me.ngrok.io'
AUDIO_URL = 'https://raw.githubusercontent.com/nexmo-community/ncco-examples/gh-pages/assets/welcome_to_nexmo.mp3'
Play Audio into a Call with Ruby
A tutorial showing you how to build an app that will play audio into a PSTN call
Steps
1
Introduction to this tutorial2
Prerequisites3
Create the Project Folder and Files4
Install Vonage Ruby5
Require Dependencies6
Initialize Vonage Client7
Add Environment Variables8
Define Constant Variables9
Create Routes10
Run the Ruby App11
What's Next?