![]() ![]() Once the project is deployed, click on the "Go to live application" button. Head over to the CodeExchange and deploy the Lookup project. Functions protect your Twilio Credentials, so you don't have to worry about storing those in your Google Sheet. ![]() You can deploy the Lookup function quickly using CodeExchange.Functions are hosted on Twilio for easier management.Instead of calling the Twilio API directly from Google Sheets, this tutorial uses Twilio Functions. It should show you the contents of your Java servlet.Create a Lookup function to call from Google Sheets Grab one of the Forwarding URLs and try opening it in the browser. ![]() Running the above command should result in an output similar to the one shown below. Next, simply execute the following command to forward HTTP port 8080 to a public IP. First, obtain the Ngrok token from the Ngrok dashboard and set it by executing the following command. Next, let us expose our Java servlet to a public IP using Ngrok. Notice, that the above response contains all the options that we set in the handler. Please leave a message after the tone and our customer executives will get back to you. curl -X POST Executing the above command should return an XML output similar to the one shown below. Instead, you can use CURL or Postman to test it out. Since our /recordIncoming servlet is of type POST, you can’t open it directly in the browser. You can navigate to the following URL to see your servlet in action. mvn jetty:runĮxecuting the above command will make the servlet available at localhost. Open up the terminal and execute the following command in the root directory of your project. Run the Maven projectįinally, let us run the Maven project and see if it works. Notice that the Record.Builder offers multiple options that can be used to customize how the recording is performed. Next, let us add a pom.xml file to the Java project with a standard configuration with required dependencies and plugins for creating a Java servlet. Create a new directory for your java project. Let us first create a new Java project that uses Maven as its build system. I will walk you through the entire process of developing and deploying a Java servlet since I struggled to find a good tutorial for the same and if you are a beginner, you might otherwise get stuck. In this section, we will write a Java servlet that can serve as a webhook for our Twilio phone number and handle incoming HTTP requests. First, let us build a Java servlet to record a part of an incoming phone call. We will come back to the Twilio console later in the tutorial to configure the phone number with a webhook URL. Check the pricing structure before buying the number. Note, that different phone numbers might have different monthly fees associated with them. Choose Phone Numbers > Manage > Buy a number from the left sidebar of the Twilio console to buy a new phone number. On the console, you can search and buy a phone number from around the world. We need to buy a Twilio phone number using the Twilio console before we can use the Twilio voice APIs. You can skip installing Ngrok and proceed to directly deploying your Java web app using a cloud provider if you are already familiar with the process. We will be testing our Java servlet by using Ngrok, so you can optionally sign up for Ngrok and install it on your device. In addition to Java, you will also need Apache Maven installed on your device to execute the Java code that we write. You can download and install Java from their official site. Also, since we will be using Twilio’s Java SDK, you need to have a Java development environment set up on your device. You can sign up for a trial account here if you don’t already have an account. You will require a Twilio account for this tutorial. The voice APIs provide a myriad of features including interactive voice response, speech recognition, and voice recording. Twilio provides powerful voice APIs that can be used to build an engaging voice experience that can be easily scaled to millions of users. In this tutorial, I will walk you through the process of recording a phone call using Twilio’s voice APIs as part of its Java SDK. In addition to it, you could record a customer’s query instead of relying on a voice mailbox when support executives are not available for live support. Analyzing the conversations could help in improving the customer support experience. The ability to record phone conversations with ease is critical for any company’s customer support operations. Recording incoming and outbound phone conversations could be beneficial in multiple use cases for your company. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |