A completely free and open-source real-time call handling platform with AI agent tools, similar to SignalWire but without any costs.
- π WebRTC Voice Calls - Browser-based real-time audio communication
- π€ AI Agent Tools - Smart call handling with intent recognition
- π Call Transfer - Route and manage calls dynamically
- π‘ WebSocket Signaling - Fast and reliable connection management
- π° 100% Free - No hidden costs, subscriptions, or API limits
- π Easy Setup - Get started in minutes
Unlike paid services like SignalWire, Swireit provides:
- Real-time call handling - WebRTC-based voice communication
- AI agent capabilities - Intent recognition and automated responses
- Signaling server - WebSocket-based call management
- Web interface - Ready-to-use browser client
- REST API - Programmatic call control
- Open source - Modify and extend as needed
- Node.js 18+ installed
- Modern web browser with WebRTC support
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm startThe server will start on port 3000 (or PORT environment variable).
npm run dev- Open http://localhost:3000 in your browser
- Enter a client ID (username) and click "Connect"
- Open another browser window/tab with a different client ID
- Enter the other client's ID and click "Start Call"
- The other client will receive an incoming call notification
Health Check
GET /api/healthGet Active Calls
GET /api/callsAI Agent Processing
POST /api/ai/process
Content-Type: application/json
{
"transcript": "Hello, I need help",
"context": {}
}Connect to ws://localhost:3000 and send:
Register Client
{
"type": "register",
"clientId": "user123"
}Make a Call
{
"type": "call",
"to": "user456",
"offer": <RTCSessionDescription>
}The platform includes a basic AI agent that can:
- Recognize greetings and respond appropriately
- Understand help requests
- Detect transfer/forward intents
- Provide contextual responses
You can integrate free AI services:
- Hugging Face - Free inference API
- OpenAI Free Tier - Limited free tokens
- Local Models - Run models like Llama locally
- Rasa - Open-source conversational AI
Swireit can forward AI processing to the AISec backend (https://github.com/DaddyFilth/aisec) for advanced call screening. AISec is public and can be initialized from this repo.
- Clone and start AISec from the repo:
git clone https://github.com/DaddyFilth/aisec.gitcd aisec- Follow the AISec README to configure and run the service (the default endpoint is
/api/ai/process).
- Add the following to your
.envfile in this repo:
AISEC_API_URL=http://localhost:8080/api/ai/process
AISEC_API_KEY=your_aisec_api_key
AISEC_TIMEOUT_MS=5000
SWIREIT_PROJECT_ID=your_swireit_project_id
SWIREIT_API_TOKEN=your_swireit_api_token
SWIREIT_SPACE_URL=your-space.swireit.com
SWIREIT_CALLER_ID=+15551231234
SWIREIT_TWIML_URL=your_swireit_twiml_url
SWIREIT_VALIDATE_WEBHOOKS=true- Ensure Swireit is running, then initialize AISec with the Swireit settings:
npm run init:aisecThis copies the Swireit settings into the AISec .env.local file so AISec can start with your Swireit configuration. Swireit should already be running before you run the init step. You can override the AISec location with AISEC_DIR=/path/to/aisec npm run init:aisec.
- Restart AISec so it picks up the updated
.env.local.
Swireit will call AISec when AISEC_API_URL is set, and fall back to the built-in rules if AISec is unavailable.
Example integration in src/server.ts:
import fetch from 'node-fetch';
async function processWithAI(transcript: string) {
// Example: Use Hugging Face free API (no cost, no API key required for basic usage)
const response = await fetch(
'https://api-inference.huggingface.co/models/facebook/blenderbot-400M-distill',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ inputs: transcript })
}
);
return await response.json();
}βββββββββββββββ WebSocket βββββββββββββββ
β Client A ββββββββSignalingβββββββββββΊβ Server β
βββββββββββββββ βββββββββββββββ
β β
β WebRTC Audio β
βββββββββββDirect P2PβββββββββββββΊβ β
β β β
βββββββββββββββ βββββββββββββββ
β Client B β β AI Agent β
βββββββββββββββ βββββββββββββββ
Create a .env file:
PORT=3000- Customer Support - AI-powered call routing
- Conference Calling - Multi-party voice chat
- Voice Assistants - Build custom voice bots
- Call Centers - Free alternative to expensive platforms
- Testing - WebRTC development and testing
| Feature | Swireit | SignalWire |
|---|---|---|
| Voice Calls | β Free | π° Paid |
| AI Integration | β Free | π° Paid |
| WebRTC | β Yes | β Yes |
| Cost | π $0 | πΈ Usage-based |
| Open Source | β Yes | β No |
| Self-Hosted | β Yes | β No |
For production use:
- Add authentication/authorization
- Use HTTPS/WSS for encryption
- Implement rate limiting
- Add input validation
- Use secure TURN servers for NAT traversal
MIT License - Use freely for any purpose
Contributions welcome! This is a free alternative to expensive platforms.
- Recording capabilities
- Group calling (3+ participants)
- Screen sharing
- Advanced AI models integration
- Call analytics dashboard
- SIP gateway integration
- Mobile app support
Built with β€οΈ as a free alternative to expensive call platforms