# AI Telephony Agent
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.
## Installation
### Prerequisites
- Python 3.11+
- VideoSDK account
- Twilio account (SIP trunking provider)
- Google API key (for Gemini AI)
### Setup
1. **Clone the repository**
```bash
git clone https://github.com/yourusername/ai-agent-telephony.git
cd ai-agent-telephony
```
2. **Install dependencies**
```bash
pip install -r requirements.txt
```
3. **Configure environment variables**
Create a `.env` file:
```env
# VideoSDK Configuration
VIDEOSDK_AUTH_TOKEN=your_videosdk_token
VIDEOSDK_SIP_USERNAME=your_sip_username
VIDEOSDK_SIP_PASSWORD=your_sip_password
# AI Configuration
GOOGLE_API_KEY=your_google_api_key
# Twilio SIP Trunking Configuration
TWILIO_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_NUMBER=your_twilio_number
```
4. **Run the server**
```bash
python server.py
```
The server will start on `http://localhost:8000`
## API Endpoints
### Handle Inbound Calls (SIP User Agent Server)
```bash
POST /inbound-call
```
Handles incoming calls from your SIP provider. Expects Twilio webhook parameters, either host this server or use `ngrok`:
```bash
POST