twilio-fallback

command module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README ΒΆ

πŸš€ Twilioβ„’ Fallback Service

License Go Report Card GitHub Actions Status

A service that provides a fallback mechanism for Twilio SMS messages using SMSGate.

πŸ“– Overview

Many companies using Twilio's SMS API encounter challenges maintaining optimal deliverability rates, especially concerning evolving industry requirements. Existing software built for Twilio often lacks the flexibility to integrate with alternative SMS gateways without significant code modifications.

This Twilio Fallback Service provides a solution by acting as a bridge between Twilio and SMSGate. It intercepts Twilio failure webhooks, extracts the necessary message details, and reroutes the messages via SMSGate, enabling seamless fallback without requiring any changes to the existing Twilio-based software.

πŸ“ Description

The Twilio Fallback Service handles Twilio message failure callbacks and resends failed messages via the SMSGate API. This service ensures that critical messages are delivered even if the primary Twilio channel fails.

πŸ“– Table of Contents

πŸš€ Getting Started

βš™οΈ Prerequisites
  • Linux VPS with a public IP address
  • Docker (if using Docker deployment)
  • Domain name and SSL certificate (strongly recommended)
πŸ“¦ Installation

Choose one of the following installation methods:

1. Pre-built Binaries

Download the appropriate binary for your system from the GitHub Releases page.

2. Docker Image

Alternatively, you can use the Docker image hosted on ghcr.io:

docker pull ghcr.io/android-sms-gateway/twilio-fallback:latest

βš™οΈ Configuration

Create a .env file in the root directory of the project. Copy the contents from .env.example and fill in the required values.

To enable the fallback mechanism, configure your Twilio account to send message status callbacks to the service's endpoint: [YOUR_SERVICE_URL]/api/twilio. This endpoint will receive webhooks for failed or blocked messages and automatically resend them via SMSGate. For more information on setting up Twilio callbacks, see the Twilio documentation.

The following environment variables are available to configure the service:

Variable Description Default
HTTP__ADDRESS HTTP server address 127.0.0.1:3000
HTTP__PROXY_HEADER HTTP proxy header empty
HTTP__PROXIES Comma separated list of trusted proxies empty
TWILIO__ACCOUNT_SID Twilio account identifier required
TWILIO__AUTH_TOKEN Twilio authentication token required
TWILIO__CALLBACK_URL Publicly accessible URL for Twilio callbacks Dynamic based on Host header
SMSGATE__BASE_URL SMSGate API endpoint https://api.sms-gate.app/3rdparty/v1
SMSGATE__USERNAME SMSGate API username required
SMSGATE__PASSWORD SMSGate API password required
SMSGATE__TIMEOUT SMSGate API timeout 1s

πŸš€ Deployment

Local Deployment

To run the service locally:

./twilio-fallback
Docker Deployment

Run the Docker container:

docker run -p 3000:3000 --env-file .env ghcr.io/android-sms-gateway/twilio-fallback:latest

πŸ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

This project is not affiliated with, endorsed by, or sponsored by Twilio. It is an independent project that utilizes the Twilio API.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
server/docs
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL