4. Test the application
Now it's time to test the application!
Start the ngrok tunnel and update the Callback URL
First we need to open a tunnel to your local machine using ngrok and then use that URL to update the Callback URL of your Voice app on your Sinch Customer Dashboard.
- Open a command prompt or terminal and run this command:This will open an ngrok tunnel on port 8090. We are opening the tunnel on port 8090 because this is the port on which the server will run, based on the configuration in the
ngrok http 8090
application.yaml
. If for whatever reason you need to use another port, simply update the desired port in that file, and then start the ngrok tunnel on that port instead. - In the console you should see that the ngrok tunnel has started on the specified port. Take note of the Forward URL, which should look something like this:
Forwarding https://4a61-75-118-121-186.ngrok-free.app
- Copy that URL and add
/VoiceEvent
to the end of it, resulting in something like this:https://4a61-75-118-121-186.ngrok-free.app/VoiceEvent
- Navigate to your Voice app and locate the
Settings
section. - In the "Handle call events with" field, paste the URL you created. Now your Voice app will forward any call events to that URL, on which your server will be listening.
Start the server
Next we need to start the server.
- Open a second command prompt or terminal to the
sinch-sdk-java-quickstart/tutorials/voice/capture-leads-app
folder. This is where the POM file for the Java project lives. - In the command prompt, run this command:
mvn clean spring-boot:run
- You should notice in your console that Springboot is starting the server on port 8090 (or another port if you changed it), and once the server is running you should see a prompt in the console waiting for your input.
- Enter the phone number in E.164 format of the phone you're going to use to test this app.
- You should receive a phone call from your Sinch number. Follow the prompts in the IVR and you've successfully tested this app!
Next steps
Now that you know the basics of how to use an IVR, checkout the RunMenu documentation to see what other options are possible.