Home / Companies / Twilio / Blog / Post Details
Content Deep Dive

How to Make and Receive Phone Calls with Python, Bottle and Twilio Voice

Blog post from Twilio

Post Details
Company
Date Published
Author
Matt Makai
Word Count
1,486
Language
English
Hacker News Points
-
Summary

By creating a Bottle web application with the Twilio Voice API, developers can easily make and receive phone calls using Python. The application can read a snippet of text, play an MP3 file, or gather input from the number pad. To get started, developers need to install the required dependencies, including Bottle and Twilio, and create a new virtual environment. They then write code to define three endpoints: one that returns a simple message, another that responds with TwiML instructions for handling phone calls, and a third that sends an outbound call using Twilio's Voice API. To make the application work, developers need to obtain a phone number from Twilio and configure it in their code. They also need to use Ngrok to create a localhost tunnel to their local development environment. Once deployed, the application can be tested by dialing its own phone number or sending an outbound call using a different phone number. With this tutorial, developers can learn how to integrate voice capabilities into their web applications using Python and Twilio's Voice API.