A high-performance, enterprise-grade SIP recording (SIPREC) server that implements RFC 7865/7866 with custom TCP-optimized transport, advanced real-time transcription capabilities, and comprehensive NAT support for cloud deployments.
- 📞 RFC Compliance - Complete RFC 7865/7866 implementation for SIP session recording
- 🔄 Session Management - Advanced session lifecycle management with failover support
- 🎯 NAT Traversal - Comprehensive NAT support with STUN integration for cloud deployments
- 🔗 SIP Integration - Custom SIP server implementation optimized for TCP transport and large metadata
- 🎙️ Real-time Transcription - Enhanced multi-provider STT with streaming capabilities (Google, Deepgram, OpenAI, Azure)
- 👥 Speaker Diarization - Multi-speaker identification and word-level speaker tagging
- 🎵 Audio Processing - Advanced VAD, noise reduction, and multi-channel mixing
- 🌐 WebSocket Streaming - Real-time transcription delivery with circuit breaker patterns
- 📊 Quality Metrics - Audio quality monitoring and adaptive processing with performance optimization
- 🔐 Security - End-to-end encryption with TLS/SRTP and configurable key rotation
- 📨 Message Queue - AMQP integration with delivery guarantees and circuit breakers
- 📈 Monitoring - Comprehensive metrics, health checks, and operational visibility
- ☁️ Cloud Ready - Optimized for GCP, AWS, Azure with automatic configuration
# One-command deployment
./deploy-quick.sh
# Or with Terraform
terraform init
terraform apply -var="project_id=YOUR_PROJECT_ID"
# Download and run deployment script
wget https://raw.githubusercontent.com/loreste/siprec/main/deploy_gcp_linux.sh
chmod +x deploy_gcp_linux.sh
sudo ./deploy_gcp_linux.sh
# Production deployment
docker run -d \
--name siprec-server \
--restart unless-stopped \
-p 5060:5060/udp \
-p 5060:5060/tcp \
-p 5061:5061/udp \
-p 8080:8080 \
-v $(pwd)/recordings:/var/lib/siprec/recordings \
-v $(pwd)/config:/etc/siprec \
-e BEHIND_NAT=true \
-e EXTERNAL_IP=auto \
ghcr.io/loreste/siprec:latest
# Clone repository
git clone https://github.com/loreste/siprec.git
cd siprec
# Build from source
go build -o siprec ./cmd/siprec
# Run with default configuration
./siprec
The server can be configured via environment variables or a .env
file:
# Network Configuration (NAT Optimized)
BEHIND_NAT=true # Enable NAT support
EXTERNAL_IP=auto # Auto-detect external IP
INTERNAL_IP=auto # Auto-detect internal IP
PORTS=5060,5061 # SIP listening ports
RTP_PORT_MIN=16384 # RTP port range start
RTP_PORT_MAX=32768 # RTP port range end
# STUN Configuration
STUN_SERVER=stun:stun.l.google.com:19302
# Security
ENABLE_TLS=true # Enable TLS for SIP
TLS_CERT_PATH=/path/to/cert.pem # TLS certificate
TLS_KEY_PATH=/path/to/key.pem # TLS private key
ENABLE_SRTP=true # Enable SRTP for media
# Transcription
STT_DEFAULT_VENDOR=google # STT provider
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
# Recording
RECORDING_DIR=/var/lib/siprec/recordings
RECORDING_MAX_DURATION=4h
ENABLE_RECORDING_ENCRYPTION=false
# STT Provider
STT_PROVIDERS=google-enhanced # Enhanced providers: google-enhanced, deepgram-enhanced, openai, azure
STT_ENABLE_DIARIZATION=true # Enable speaker diarization
STT_ENABLE_WORD_TIMESTAMPS=true # Enable word-level timestamps
# Audio Processing
VAD_ENABLED=true
NOISE_REDUCTION_ENABLED=true
For detailed configuration, see Configuration Guide.
Comprehensive documentation is available in the docs directory:
- 📚 Getting Started Guide
- 🔧 Installation Guide
- ⚙️ Configuration Reference
- 🎙️ STT Providers Guide
- 🚀 Production Deployment
- 🔒 Security Guide
SIPREC Server is built with a modular architecture:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ SIP/RTP │────▶│ Audio │────▶│ STT │
│ Handler │ │ Processing │ │ Provider │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Recording │ │ WebSocket/ │
│ Storage │ │ AMQP │
└─────────────┘ └─────────────┘
GET /health
- Health check endpointGET /health/live
- Kubernetes liveness probeGET /health/ready
- Kubernetes readiness probeGET /metrics
- Prometheus metricsGET /api/sessions
- Active sessionsGET /api/sessions/stats
- Session statistics
WS /ws/transcriptions
- Real-time transcription stream
# Check service status
systemctl status siprec-server
# Test health endpoint
curl http://localhost:8080/health
# Test SIP response
echo -e "OPTIONS sip:test@localhost SIP/2.0\r\nVia: SIP/2.0/UDP test:5070\r\nFrom: sip:test@test\r\nTo: sip:test@localhost\r\nCall-ID: test\r\nCSeq: 1 OPTIONS\r\nContent-Length: 0\r\n\r\n" | nc -u localhost 5060
# Run comprehensive NAT testing
./test_nat_config.sh
# Check NAT detection
curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/external-ip
# Run test suite
go test -v ./...
# Run E2E tests
./run_test.sh
# SIPREC simulation
./test/e2e/siprec_simulation_test.go
- OS: Ubuntu 20.04+, Debian 11+, CentOS 8+, RHEL 8+
- Memory: 4GB RAM minimum, 8GB recommended
- CPU: 2 cores minimum, 4 cores recommended
- Storage: 50GB minimum for recordings
- Network: Public IP for external access
- Concurrent Sessions: 100+ simultaneous recordings
- Audio Quality: PCM/G.711/G.722 codec support
- Latency: <100ms for real-time transcription
- Throughput: 1000+ RTP packets/second per session
# Multiple instances with load balancer
# Session state stored in external database
# Shared storage for recordings
# AMQP clustering for message reliability
# Prometheus metrics
curl http://localhost:8080/metrics
# Key metrics to monitor:
# - siprec_active_calls
# - siprec_rtp_packets_received
# - siprec_transcription_errors
# - siprec_session_duration
# SystemD commands
sudo systemctl start siprec-server
sudo systemctl stop siprec-server
sudo systemctl restart siprec-server
sudo systemctl status siprec-server
# View logs
sudo journalctl -u siprec-server -f
# Configuration reload
sudo systemctl reload siprec-server
# Check configuration
./siprec envcheck
# Test connectivity
netstat -tulpn | grep 5060
# Debug NAT issues
./test_nat_config.sh
# View detailed logs
tail -f /var/log/siprec/siprec.log
- Call Recording: Automatic SIPREC-compliant call recording
- Quality Assurance: Real-time transcription for agent monitoring
- Compliance: Regulatory compliance with complete audit trails
- Meeting Recording: Conference call recording and transcription
- Training: Call analysis and training material generation
- Analytics: Voice analytics and sentiment analysis
- Service Provider: SIPREC recording for telecom operators
- Legal Compliance: Lawful intercept and recording capabilities
- Network Analysis: Call quality and performance monitoring
Feature | SIPREC Server | Commercial Solutions | Open Source Alternatives |
---|---|---|---|
RFC Compliance | ✅ Full RFC 7865/7866 | ✅ Yes | |
Real-time Transcription | ✅ Multi-provider | ✅ Yes | ❌ No |
NAT Support | ✅ Advanced | ✅ Yes | |
Cloud Ready | ✅ Optimized | ✅ Yes | |
Cost | ✅ Open Source | ❌ Expensive | ✅ Free |
Customization | ✅ Full Control | ❌ Limited | ✅ Yes |
We welcome contributions from the community! Please see our Contributing Guide for details.
# Clone and setup
git clone https://github.com/loreste/siprec.git
cd siprec
# Install dependencies
go mod download
# Run tests
go test -v ./...
# Build
go build -o siprec ./cmd/siprec
- Follow Go best practices and idioms
- Write comprehensive tests for new features
- Update documentation for user-facing changes
- Use conventional commit messages
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Complete Docs: docs/README.md
- Deployment Guide: README-DEPLOYMENT.md
- NAT Analysis: nat_analysis.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
For enterprise support, custom development, or consulting services, please contact us through the repository.
Built with ❤️ for the VoIP and telecommunications community