Make INBOUND and OUTBOUND calls with AI agents using VideoSDK. Supports multiple SIP providers and AI agents with a clean, extensible architecture for VoIP telephony solutions.
- Python 3.11+
- VideoSDK account
- Twilio account (SIP trunking provider)
- Google API key (for Gemini AI)
- Clone the repository
- Install dependencies
- Configure environment variables Create a .env file:
- Run the server
The server will start on http://localhost:8000
Handles incoming calls from your SIP provider. Expects Twilio webhook parameters, either host this server or use ngrok:
- CallSid: Unique call identifier
- From: Caller's phone number (CLI - Calling Line Identification)
- To: Recipient's phone number (DID - Direct Inward Dialing)
Switch SIP providers at runtime (currently supports: twilio).
The modular architecture makes it easy to add new SIP providers and SIP trunking services. Here's how to add a new provider:
Create providers/your_provider.py:
Add to providers/__init__.py:
Update config.py:
Similarly, you can add new AI agents for intelligent call handling:
Create ai/your_ai_agent.py:
Add to ai/__init__.py:
| VIDEOSDK_AUTH_TOKEN | VideoSDK authentication token | ✅ |
| VIDEOSDK_SIP_USERNAME | VideoSDK SIP username | ✅ |
| VIDEOSDK_SIP_PASSWORD | VideoSDK SIP password | ✅ |
| GOOGLE_API_KEY | Google API key for Gemini | ✅ |
| TWILIO_SID | Twilio account SID | ✅ |
| TWILIO_AUTH_TOKEN | Twilio auth token | ✅ |
| TWILIO_NUMBER | Twilio phone number | ✅ |
For additional SIP providers, add their specific environment variables to config.py.
- SIP/VoIP Integration: Pluggable SIP providers (Twilio, and more) with session initiation protocol support
- AI-Powered Voice Agents: Pluggable AI agents (Gemini, and more) for intelligent call handling
- Real-time Voice Communication: AI agents with real-time transport protocol (RTP) capabilities
- Modular Architecture: Clean separation of concerns for scalable telephony solutions
- Runtime Configuration: Switch SIP providers and AI agents without restart
- VideoSDK Integration: Seamless room creation and session management
- Call Control: Advanced call routing, forwarding, and transfer capabilities
- Codec Support: Multiple audio codecs for optimal voice quality
- AI agents handle customer inquiries via VoIP
- 24/7 availability with SIP trunking
- Consistent service quality across PSTN and IP networks
- Automated appointment booking via SIP calls
- Reminder calls using SIP user agent client
- Rescheduling assistance with DTMF support
- Automated survey calls over SIP
- Customer feedback collection via VoIP
- Data collection with real-time transport protocol
- Automated emergency alerts via SIP trunking
- Mass notification systems using PSTN integration
- Status updates through IP multimedia subsystem (IMS)
- Separation of Concerns: Each component has a single responsibility
- Extensibility: Easy to add new SIP providers and AI agents
- Testability: Components can be tested in isolation
- Maintainability: Clear structure makes code easier to understand
- Reusability: Components can be reused across different projects
- Configuration Management: Centralized configuration with validation
- SIP Compliance: Full session initiation protocol support
- VoIP Integration: Seamless integration with voice over internet protocol
- Add support for multiple AI agents per session
- Implement SIP-specific features (SBC, registrar, proxy server)
- Add monitoring and metrics for SIP sessions
- Create provider-specific webhook handlers
- Add support for different voice codecs per AI agent
- Implement call recording and transcription
- Add sentiment analysis for call quality
- Create web dashboard for call management
- Support for H.323 protocol integration
- Advanced call control features (forwarding, transfer, queue)
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
- Follow the existing code patterns
- Add proper error handling
- Include logging
- Update documentation
- Add tests if possible
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the developer community
.png)
