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

Record Bad Customer Service Calls in 30 Lines of Ruby

Blog post from Twilio

Post Details
Company
Date Published
Author
Greg Baugues
Word Count
1,364
Company Posts That Month
19
Language
English
Hacker News Points
-
Post removed?
No
Summary

This article describes a Ruby-based solution to record phone calls made to a Twilio phone number and send the recording as an SMS to the caller's phone number. The code uses Sinatra, a lightweight web framework, and the Twilio Ruby gem to interact with Twilio's REST API. By setting up a local development machine with ngrok, a publicly accessible URL can be created for the recorded call. When a call is made to the Twilio number, it triggers a POST request to the `/call` route, which generates TwiML and starts recording the call. After the call is finished, the `after-record` callback is triggered, which sends an SMS with a link to the recorded call using Twilio's REST API. The code was built using only 30 lines of Ruby, making it a concise solution for consumer protection against bad customer service.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.