A high-performance SMS gateway built in Go that bridges telecom networks with modern applications. This service provides robust SMPP protocol support, efficient message queuing, and reliable delivery tracking.
- 🔄 Multi-Provider Support: Connect to multiple SMPP providers simultaneously
- 📊 Prometheus Metrics: Real-time monitoring of message throughput and delivery rates
- 🚦 Rate Limiting: Configurable rate limiting per provider to prevent throttling
- 🔁 Message Queuing: Redis-backed message queue for reliable message handling
- 📋 Delivery Reports: Track message delivery status with detailed reporting
- 🔌 Flexible Session Types: Support for transceiver, receiver, and transmitter sessions
- 🛡️ Graceful Shutdown: Clean handling of connection termination and message processing
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Client │ │ SMS Gateway │ │ SMSC │
│ Application│────▶│ Service │────▶│ Providers │
└─────────────┘ └─────────────┘ └─────────────┘
│
┌─────┴─────┐
│ │
┌────▼───┐ ┌────▼───┐
│ Redis │ │Database│
│ Queue │ │ │
└────────┘ └────────┘
For more details on the system architecture, see our Architecture Documentation.
- Go 1.18+
- Redis server
- MySQL/MariaDB database
For detailed installation instructions, see our Installation Guide.
Create a config.yaml
file with your SMPP provider details:
rate_limit: 100
redis_url: "127.0.0.1:6379"
database_config:
host: "localhost"
port: 3306
user: "root"
password: "your_password"
dbname: "sms_gateway"
max_conn: 50
max_idle: 25
providers:
- provider1:
name: "provider1"
session_type: "transceiver"
address: "smpp.provider1.com"
port: 2775
system_id: "your_id"
password: "your_password"
system_type: ""
rate_limit: 500
burst_limit: 500
max_outstanding: 500
has_outstanding: true
max_retries: 3
queues:
- "go-provider1-ported"
- "go-provider1"
For detailed configuration options, see our Configuration Documentation.
# Start the service with default config
./run.sh
# Start with a specific config file
./run.sh custom-config.yaml
The SMS Gateway provides a RESTful API for message submission and status tracking. For detailed API documentation, see our API Documentation.
The service exposes Prometheus metrics for monitoring:
- Message throughput rates
- Delivery success/failure rates
- Queue depths
- Provider connection status
For detailed information about available metrics and monitoring setup, see our Monitoring Documentation.
See our Future Enhancements documentation for detailed information about planned improvements.
- 🧪 Comprehensive unit test coverage
- 🔄 Integration tests with mock SMPP servers
- 🧮 Load testing framework for performance benchmarking
- 📝 Test profiles for complex scenarios including throttling and packet loss
- ⚡ Connection pooling for higher throughput
- 🔄 Bulk database operations for status updates
- 🚀 Optimized message encoding/decoding
- 📊 Enhanced metrics collection and visualization
- 🔄 Automatic session reconnection with exponential backoff
- 💾 Message persistence across restarts
- 🛡️ Enhanced error handling and recovery mechanisms
- 🔄 Background synchronization for delivery reports
- 🔧 Admin dashboard for monitoring and configuration
- 📱 REST API for message submission and status queries
- 🔐 Enhanced security features and authentication
- 📋 Comprehensive logging and audit trails
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.