Complete installation and configuration walkthrough for SIPSentinel.
Before you begin, you'll need accounts with:
- Twilio (for phone numbers and webhooks)
- VAPI (for AI agents)
- OpenRouter (for LLM scam detection)
- AWS (for storage and transcription)
git clone https://github.com/michael-bey/SIPSentinel.git
cd SIPSentinel
npm installRun the setup wizard to configure your environment:
npm run setupThis will guide you through:
- Creating your
.envfile - Configuring API keys
- Validating your setup
- Creating VAPI agents
npm run validatenpm run create-agents --allConfigure VAPI to send webhooks for Telegram audio uploads:
npm run configure-vapiThis step is critical for Telegram audio uploads to work. It configures your VAPI assistants to send webhook events when calls start and end.
# Start with web dashboard
npm start
# Or start in headless mode (webhooks only)
npm run headlessIf you prefer manual setup, follow these steps:
Copy the example environment file:
cp .env.example .envEdit .env with your actual credentials:
# Twilio Configuration
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=+1234567890
# VAPI Configuration
VAPI_API_KEY=your_vapi_api_key
# OpenRouter Configuration
OPENROUTER_API_KEY=your_openrouter_api_key
# AWS Configuration
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-west-2
# Server Configuration
PORT=3000- Sign up at twilio.com
- Get a phone number with voice and SMS capabilities
- Note your Account SID and Auth Token from the console
- Configure webhooks (see Twilio Setup)
- Sign up at vapi.ai
- Get your API key from the dashboard
- Optionally create custom agents (or use our templates)
- Configure webhook URLs (see VAPI Webhook Configuration section)
- Sign up at openrouter.ai
- Get your API key
- Add credits for LLM usage (Llama 3.3 8B is free)
- Create an AWS account
- Create an IAM user with these permissions:
- S3: Full access to your bucket
- Transcribe: Basic transcription permissions
- Note your access key and secret key
Configure these URLs in your Twilio Console:
Voice URL: https://your-domain.com/voice
SMS URL: https://your-domain.com/sms
Recording Status Callback: https://your-domain.com/recording-status
Transcription Callback: https://your-domain.com/transcription
Configure VAPI to send webhooks when calls start and end. This is required for Telegram audio uploads to work.
Option 1: Using CLI (Recommended)
npm run configure-vapiOption 2: Manual Configuration in VAPI Dashboard
- Go to VAPI Dashboard
- For each assistant, go to the "Advanced" tab
- Set Server URL to:
https://your-domain.com/api/webhooks/vapi
Option 3: Organization-wide Configuration
- Go to Organization Settings
- Set Server URL to:
https://your-domain.com/api/webhooks/vapi
For local development, use ngrok or similar:
ngrok http 3000
# Then use the ngrok URL for webhooksThe system includes pre-configured agent templates for different scam types:
- Coinbase Jim - Crypto exchange scam response
- Kraken Support Victim - Kraken-specific scam response
- Binance User Sarah - Binance-specific scam response
- Microsoft Support Victim - IT support scam response
# Create all agent templates
npm run create-agents --all
# Create specific template
npm run create-agents --template coinbaseAgent templates are defined in bin/create-agents.js. You can:
- Modify existing templates
- Add new templates for other companies
- Customize voices, personalities, and responses
- Adjust conversation strategies
The system supports multiple operation modes:
# Show help
sipsentinel help
# Interactive setup
sipsentinel setup
# Validate configuration
sipsentinel validate
# Create agents
sipsentinel create-agents --all
# Configure VAPI webhooks
sipsentinel configure-vapi
# Start with web UI (default)
sipsentinel start --web-ui
# Start in headless mode
sipsentinel start --headless
# Custom port
sipsentinel start --port 8080# Test with your phone number
curl "http://localhost:3000/test-call?phone=+1234567890&scamType=crypto_exchange"
# Test Coinbase agent specifically
curl "http://localhost:3000/test-coinbase?phone=+1234567890"Call your Twilio phone number and leave a voicemail with scam-like content:
"Hello, this is Coinbase security. Your account has been compromised.
Please call us back immediately at 1-800-555-0123 to verify your account."
The system should:
- Detect the scam
- Initiate a callback to the scammer's number
- Display the interaction in the web dashboard
Access the web dashboard at your deployment URL to monitor:
- Recent scam detections
- Agent conversations
- Success metrics
- Call analytics
GET /health- System health checkGET /api/dashboard- Dashboard dataGET /vapi/analytics- Call analyticsGET /deployment-info- Configuration info
-
Environment Variables Not Set
npm run validate
-
Twilio Webhooks Not Working
- Check webhook URLs in Twilio console
- Verify your deployment is accessible
- Check server logs for errors
-
VAPI Agents Not Responding
- Verify VAPI API key
- Check agent creation logs
- Test with simple agent first
-
Telegram Audio Uploads Not Working
- Verify VAPI webhook configuration:
npm run configure-vapi - Check webhook URL is accessible from internet
- Verify Telegram bot token and chat ID
- Check server logs for webhook events (
call.start,call.end) - Ensure QStash is configured for background task processing
- Verify VAPI webhook configuration:
-
Scam Detection Not Working
- Check OpenRouter API key and credits
- Verify LLM model availability
- Test with known scam phrases
Enable debug logging:
DEBUG=true- Keep API keys secure and never commit them to git
- Use environment variables for all sensitive data
- Regularly rotate API keys
- Monitor usage and costs
- Review agent conversations for quality
For high-volume deployments:
- Use multiple VAPI phone numbers
- Implement rate limiting
- Monitor API usage and costs
- Consider using dedicated AWS resources
- Set up proper logging and monitoring
After setup is complete:
- Review the System Architecture
- Configure Slack or Telegram notifications
- Explore Agent Customization
- Set up Monitoring and Analytics