Identify Unknown Phone Numbers with Python 3, AWS Lambda, Twilio Lookup and SMS
Ever receive a text, probably from an old friend, but you don’t have their number saved? And you’re too embarrassed to ask, “Who is this?”.
Don’t worry. We’ve all been there. But today, we’re here to tell you that we have a solution to avoid this situations! Let's build a small Python app that uses Twilio Lookup and SMS to help you lookup phone numbers over text on the go.
The Tech Stack of Our App
Our app will use two AWS products and two Twilio APIs:
- AWS Lambda: the serverless environment which will hold our functions
- Amazon API Gateway: our API which exposes our Lambda to our Twilio number
- Lookup: to look up the phone number and see who it belongs to
- SMS: to send us a text with the phone number.
Here’s how everything will work together:
- We’ll send a text ...
Build Real-time Apps in PHP using WebSockets, Laravel and Twilio Sync
Twilio Sync is a powerful API which allows us at Momentum, an online travel agency, to keep our dashboards up to date with its WebSockets entities. Pairing it with Laravel’s Broadcasting feature, however, gave us the ability to efficiently dispatch, queue, serialize and log our Twilio Sync calls from Laravel. In this post, I will walk you through how you can extend Laravel’s framework to make use of Twilio Sync natively.
Additionally, from this tutorial we will:
- Learn about Twilio Sync Streams
- Implement Twilio as a Service Container within Laravel
- Creating a Driver for Laravel’s
- Create a REST API for Twilio callbacks
Require the Twilio SDK
First, we will need a Laravel project. Version 5 is recommended. For this walkthrough, I will be using the latest version available (at the time of writing, 5.7). If you're using Valet or are comfortable with command line installs, run ...
Sending Text Messages with Red and Twilio
Red is a next-gen programming language, strongly inspired by REBOL. It is both an imperative and functional programming language.
Red is different from other languages. With Red we'll be able to cross-compile GUI applications into stand-alone executables about 1 MB in size. As Gregg Irwin (Red Community Manager) puts it, we will look like superheroes, but our sidekick is the one doing all the work.
What are we going to build
"A picture is worth a thousand words", our stand-alone GUI application will look something like this:
It contains an input field for the destination phone number, another input field for the body of the message and a "Send" button. Pretty simple. Let's build this! (Oh..., and let's do it in 50 lines of code or less, no Xcode, Visual Studio or things like that, Red has the "batteries included".)
Setting Up for Development
To get started we need:
- A ...
How To Build A WhatsApp Chatbot Using Twilio, Dialogflow and PHP
Introduction to Natural Language Processing
Natural Language Processing (NLP), is a branch of Artificial Intelligence (AI) that helps computers understand, interpret and manipulate human language. With the help of Natural Language Understanding (NLU), which is a branch of NLP, computers are able to handle the nuances of language. For example, there are different ways of asking about the color of a shirt:
- Does it come in another color?
- Are there other colors?
- Can I get it in black?
It is very hard to anticipate all user inputs in our code but thanks to NLU, we’re able to handle different inputs.
DialogFlow, powered by Google, provides a Natural Language Understanding engine that allows us to build conversational interfaces. In this tutorial, we’re going to use Dialogflow with a PHP fulfillment webhook to build a conversational experience for a WhatsApp weather chatbot.
This tutorial requires a basic knowledge ...
Using Twilio to Build a Serverless SMS Raffle in Python
If you’re like me, you drool just a little bit over serverless architectures. When Rackspace and AWS EC2 made cloud-based computing a mainstream reality, that was awesome enough. But you still had to spin up and maintain your own virtual servers.
With the introduction of things like Twilio Functions or Lambda for truly serverless function execution, DynamoDB for cached state, and API Gateway for click-and-deploy routing—just to name a few—it’s become deliciously easy to build and deploy powerful (and fun) services in minutes. Seriously, the IoT possibilities are endless!
With that in mind, let’s build something fun with Python – a Serverless SMS Raffle. What if users could text a word to a phone number and were entered in to a raffle? Then when we were ready to choose a winner, we could execute a Lambda to choose some number of winners at random and close ...
Now You Can Add Programmable Voice Participants to Video Group Rooms
We’ve heard from customers who’ve built apps with Twilio Video that they’d like to add in callers from SIP or the PSTN (Public Switched Telephone Network), as there are times where Participants would like to dial-in to the Room from a telephone.
Starting today, you can now connect Participants from the PSTN or over SIP audio to Programmable Video Group Rooms or Small Group Rooms (for simplicity in this post we’ll refer to both Room types as Group Rooms).
Now, with just a few lines of code, you can:
- Receive phone calls to a Video Group Room from any Twilio phone number
- Make outbound phone calls to add Participants to a Video Group Room.
PSTN/SIP Participants will be able to share their audio to the Video Group Room and will receive a mixed audio stream from the other participants connected to the Room.
New TwiML ...
Is Someone Else Using Your Twilio Account? Best Practices to Protect Your Auth Token
With over 5 billion mobile phone users in the world, attackers are constantly finding ways to take advantage of unsuspecting people via their connected devices. Smishing — using SMS to socially engineer information — is a very common attack that telecommunications carriers are working to address. Posing as a trustworthy entity, a bad actor sends text messages to request personal information such as passwords or credit card numbers. If even a few people fall for the bait the scheme can pay off, especially if the attacker is using stolen Twilio account credentials to send the messages.
At Twilio, we place an immense value on trust, which is why we want to help protect you and your users from smishing attacks. In this post, we share a few best practices for protecting your account.
Best Practices for Fraud and Phishing Prevention with Twilio
Someone who steals your Twilio auth token can use your ...
How to Call the Twilio API from Java Programs on the Commandline
If you you need to do a quick Twilio test, or compile and run programs on a remote computer without any GUI, or run test programs on your own computer and you don’t want to use a full blown IDE development environment, this is the article for you.
Check Java Installation
Confirm that you have a Java runtime environment (JRE) on your computer for running Java class files:
$ java -version java version "1.8.0_131"<br/>Java(TM) SE Runtime Environment (build 1.8.0_131-b11)<br/>Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) Check that you have the Java compiler on your computer: $ javac Usage: javac <options> <source files> ...
If you don’t have both, please go to Oracle’s Java SE page and download the Java JDK.
The Java Standard Edition (Java SE) is what you need for developing ...
Using Dependency Injection with Twilio SMS and ASP.NET Core 2.1
ASP.NET Core is built with first-class support for dependency injection (DI). It's used heavily by the framework, but you can also use it with your own classes. The Twilio C# helper libraries are largely
static, so you don't have to use DI, but sometimes you might want to. For example, you might want to create a custom
TwilioRestClientthat uses the
HttpClientFactoryfeatures of .NET Core 2.1. In this post, I describe how to create a custom
ITwilioRestClient, register it with the ASP.NET Core DI container, and inject it into a web API controller, so you can use it to send an SMS.
To follow along with this post you'll need:
- A Twilio account (sign up for a free Twilio account here)
- .NET Core 2.1 SDK (version 2.1.300 or greater)
- VS Code, Visual Studio, or other editor
- Postman for testing your API
Add a Click To Call Button & SMS Chat to Your Joomla Site
As a Joomla community volunteer, I am always looking for opportunities to help my favorite CMS grow and add new features. Following these ideas, Twilio and Joomla are a perfect match to bring the possibilities of a first-level communication platform to small and medium-size organizations. In this blog post, I am going to create the required extensions for Joomla to incorporate a simple communication channel to a website by creating a click to call button.
I have planned a series of articles about the topic of implementing a communication solution for Joomla based on Twilio. In this first installment, I provide a ready-to-use extension for Joomla and the detailed steps to implement it (no coding skills are required). Later on, I’ll publish the rationale behind the development process.
If you are looking for a simple solution, you can just download the latest release and deploy it on your site ...