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
- βΈοΈ Pause/Resume Control - Real-time pause and resume of recording and transcription via REST API
- π― 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 Streaming Transcription - Enhanced multi-provider STT with full WebSocket streaming support (Google, Deepgram, OpenAI, Azure, Amazon)
- β‘ Streaming Response Support - Real-time callback-based transcription with interim and final results
- π₯ Speaker Diarization - Multi-speaker identification and word-level speaker tagging
- π‘οΈ PII Detection & Redaction - Automatic detection and redaction of SSNs, credit cards, and other sensitive data from transcriptions and audio
- π΅ 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
- π Provider Interface Standardization - Unified callback interface across all STT providers
- π 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, amazon
STT_ENABLE_DIARIZATION=true # Enable speaker diarization
STT_ENABLE_WORD_TIMESTAMPS=true # Enable word-level timestamps
STT_ENABLE_STREAMING=true # Enable real-time streaming transcription
# Audio Processing
VAD_ENABLED=true
NOISE_REDUCTION_ENABLED=true
# Pause/Resume Control API
PAUSE_RESUME_ENABLED=true # Enable pause/resume API
PAUSE_RESUME_REQUIRE_AUTH=true # Require API key authentication
PAUSE_RESUME_API_KEY=your-api-key # API key for authentication
PAUSE_RESUME_PER_SESSION=true # Allow per-session control
# PII Detection & Redaction
PII_DETECTION_ENABLED=true # Enable PII detection
PII_ENABLED_TYPES=ssn,credit_card # Types to detect: ssn, credit_card, phone, email
PII_REDACTION_CHAR=* # Character used for redaction
PII_APPLY_TO_TRANSCRIPTIONS=true # Apply PII filtering to transcriptions
PII_APPLY_TO_RECORDINGS=true # Apply PII marking to audio recordings
PII_PRESERVE_FORMAT=true # Preserve original format when redacting
PII_CONTEXT_LENGTH=10 # Context characters around detected PII
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
POST /api/sessions/{id}/pause
- Pause recording/transcription for specific sessionPOST /api/sessions/{id}/resume
- Resume recording/transcription for specific sessionGET /api/sessions/{id}/pause-status
- Get pause status for specific sessionPOST /api/sessions/pause-all
- Pause all active sessionsPOST /api/sessions/resume-all
- Resume all paused sessionsGET /api/sessions/pause-status
- Get pause status for all sessions
# Pause recording for a specific session
curl -X POST http://localhost:8080/api/sessions/session-123/pause \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{"pause_recording": true, "pause_transcription": false}'
# Resume a session
curl -X POST http://localhost:8080/api/sessions/session-123/resume \
-H "X-API-Key: your-api-key"
# Get pause status
curl -H "X-API-Key: your-api-key" \
http://localhost:8080/api/sessions/session-123/pause-status
# Pause all sessions
curl -X POST http://localhost:8080/api/sessions/pause-all \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{"pause_recording": true, "pause_transcription": true}'
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 streaming transcription
- Throughput: 1000+ RTP packets/second per session
- Streaming Support: Real-time interim and final transcription results
- Provider Agnostic: Unified interface across all STT vendors
# 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