Spaces:
Sleeping
Sleeping
Ajit Panday commited on
Commit Β·
3a6a328
1
Parent(s): dd5293b
Consolidate all documentation into README.md
Browse files
README.md
CHANGED
|
@@ -9,75 +9,274 @@ app_file: main.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# vBot -
|
| 13 |
|
| 14 |
-
vBot is
|
| 15 |
|
| 16 |
## Features
|
| 17 |
|
| 18 |
-
-
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
-
|
| 24 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Quick Start
|
| 27 |
|
| 28 |
-
1.
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
```bash
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# vBot - Intelligent Call Analysis System
|
| 13 |
|
| 14 |
+
vBot is an intelligent call analysis system that processes, transcribes, and analyzes phone calls using AI. It provides real-time insights, sentiment analysis, and call summaries through a modern API-based architecture.
|
| 15 |
|
| 16 |
## Features
|
| 17 |
|
| 18 |
+
- Real-time call processing and analysis
|
| 19 |
+
- AI-powered transcription and summarization
|
| 20 |
+
- Sentiment analysis and keyword extraction
|
| 21 |
+
- Modern admin interface for customer management
|
| 22 |
+
- Secure API-based architecture
|
| 23 |
+
- Webhook support for customer integration
|
| 24 |
+
- Detailed call analytics and reporting
|
| 25 |
+
|
| 26 |
+
## System Requirements
|
| 27 |
+
|
| 28 |
+
- Python 3.8 or higher
|
| 29 |
+
- MySQL 5.7 or higher
|
| 30 |
+
- Asterisk PBX system
|
| 31 |
+
- Hugging Face Space (for deployment)
|
| 32 |
+
- Customer's web server (for webhook handling)
|
| 33 |
|
| 34 |
## Quick Start
|
| 35 |
|
| 36 |
+
1. Clone the repository:
|
| 37 |
+
```bash
|
| 38 |
+
git clone https://huggingface.co/spaces/iajitpanday/vBot
|
| 39 |
+
cd vBot
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
2. Set up virtual environment:
|
| 43 |
+
```bash
|
| 44 |
+
python -m venv venv
|
| 45 |
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
3. Install dependencies:
|
| 49 |
+
```bash
|
| 50 |
+
pip install -r requirements.txt
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
4. Configure environment variables:
|
| 54 |
+
```bash
|
| 55 |
+
cp .env.example .env
|
| 56 |
+
# Edit .env with your configuration
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
5. Run the application:
|
| 60 |
+
```bash
|
| 61 |
+
python main.py
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Admin Setup
|
| 65 |
+
|
| 66 |
+
1. Access the admin interface:
|
| 67 |
+
- URL: `https://your-domain.com/admin`
|
| 68 |
+
- Default credentials: admin/admin (change immediately)
|
| 69 |
+
|
| 70 |
+
2. Create your first customer:
|
| 71 |
+
- Click "Add Customer"
|
| 72 |
+
- Fill in customer details:
|
| 73 |
+
- Name
|
| 74 |
+
- Company Name
|
| 75 |
+
- Email
|
| 76 |
+
- System will generate a unique API key
|
| 77 |
+
|
| 78 |
+
3. Configure customer webhook:
|
| 79 |
+
- Provide webhook URL where call results will be sent
|
| 80 |
+
- Optional: Set webhook secret for additional security
|
| 81 |
+
|
| 82 |
+
## Asterisk Configuration
|
| 83 |
+
|
| 84 |
+
1. Configure Asterisk dialplan:
|
| 85 |
+
```ini
|
| 86 |
+
[from-internal]
|
| 87 |
+
exten => _X.,1,Answer()
|
| 88 |
+
same => n,Record(/tmp/calls/${UNIQUEID}.wav,0,0)
|
| 89 |
+
same => n,Set(CALL_ID=${UNIQUEID})
|
| 90 |
+
same => n,Set(CALLER=${CALLERID(num)})
|
| 91 |
+
same => n,Set(CALLED=${EXTEN})
|
| 92 |
+
same => n,AGI(agi://localhost:4573/process_call)
|
| 93 |
+
same => n,Hangup()
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
2. Configure AGI settings:
|
| 97 |
+
```ini
|
| 98 |
+
[agi]
|
| 99 |
+
enabled=yes
|
| 100 |
+
port=4573
|
| 101 |
+
bindaddr=0.0.0.0
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
3. Test the configuration:
|
| 105 |
+
```bash
|
| 106 |
+
asterisk -rx "dialplan show from-internal"
|
| 107 |
+
```
|
| 108 |
|
| 109 |
+
## Customer Integration
|
| 110 |
+
|
| 111 |
+
### Webhook Setup
|
| 112 |
+
|
| 113 |
+
1. Download the webhook handler package:
|
| 114 |
+
```bash
|
| 115 |
+
git clone https://huggingface.co/spaces/iajitpanday/vBot/customer_webhook
|
| 116 |
+
```
|
| 117 |
|
| 118 |
+
2. Deploy to your web server:
|
| 119 |
```bash
|
| 120 |
+
cp -r customer_webhook/* /var/www/html/vbot-webhook/
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
3. Create database:
|
| 124 |
+
```sql
|
| 125 |
+
CREATE DATABASE vbot_calls;
|
| 126 |
+
USE vbot_calls;
|
| 127 |
|
| 128 |
+
CREATE TABLE call_records (
|
| 129 |
+
id VARCHAR(36) PRIMARY KEY,
|
| 130 |
+
customer_id INT NOT NULL,
|
| 131 |
+
caller_number VARCHAR(20) NOT NULL,
|
| 132 |
+
called_number VARCHAR(20) NOT NULL,
|
| 133 |
+
transcription TEXT,
|
| 134 |
+
summary TEXT,
|
| 135 |
+
sentiment VARCHAR(50),
|
| 136 |
+
keywords TEXT,
|
| 137 |
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
| 138 |
+
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
| 139 |
+
);
|
| 140 |
```
|
| 141 |
|
| 142 |
+
4. Configure webhook handler:
|
| 143 |
+
- Copy `config/config.example.php` to `config/config.php`
|
| 144 |
+
- Update database credentials and API key
|
|
|
|
| 145 |
|
| 146 |
+
### API Usage
|
| 147 |
|
| 148 |
+
1. Process a call:
|
| 149 |
+
```bash
|
| 150 |
+
curl -X POST https://your-domain.com/api/process-call \
|
| 151 |
+
-H "X-API-Key: your_api_key" \
|
| 152 |
+
-H "Content-Type: multipart/form-data" \
|
| 153 |
+
-F "file=@/path/to/call.wav" \
|
| 154 |
+
-H "caller_number=+1234567890" \
|
| 155 |
+
-H "called_number=+0987654321"
|
| 156 |
+
```
|
| 157 |
|
| 158 |
+
2. Response format:
|
| 159 |
+
```json
|
| 160 |
+
{
|
| 161 |
+
"success": true,
|
| 162 |
+
"message": "Call processed successfully",
|
| 163 |
+
"call_id": "uuid",
|
| 164 |
+
"transcription": "Call transcript...",
|
| 165 |
+
"summary": "Call summary...",
|
| 166 |
+
"sentiment": "positive",
|
| 167 |
+
"keywords": "keyword1, keyword2"
|
| 168 |
+
}
|
| 169 |
+
```
|
| 170 |
|
| 171 |
+
3. Webhook payload:
|
| 172 |
+
```json
|
| 173 |
+
{
|
| 174 |
+
"call_id": "uuid",
|
| 175 |
+
"caller_number": "+1234567890",
|
| 176 |
+
"called_number": "+0987654321",
|
| 177 |
+
"transcription": "Call transcript...",
|
| 178 |
+
"summary": "Call summary...",
|
| 179 |
+
"sentiment": "positive",
|
| 180 |
+
"keywords": "keyword1, keyword2",
|
| 181 |
+
"timestamp": "2024-03-14T12:00:00Z",
|
| 182 |
+
"customer_id": 123
|
| 183 |
+
}
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
## Security
|
| 187 |
+
|
| 188 |
+
1. API Authentication:
|
| 189 |
+
- All API requests require valid API key
|
| 190 |
+
- API keys are unique per customer
|
| 191 |
+
- Keys can be regenerated if compromised
|
| 192 |
+
|
| 193 |
+
2. Webhook Security:
|
| 194 |
+
- Optional webhook secret for signature validation
|
| 195 |
+
- HTTPS required for webhook endpoints
|
| 196 |
+
- Input validation and sanitization
|
| 197 |
+
|
| 198 |
+
3. Data Protection:
|
| 199 |
+
- Call recordings are temporary
|
| 200 |
+
- Analysis results stored securely
|
| 201 |
+
- Customer data isolation
|
| 202 |
+
|
| 203 |
+
## Monitoring and Maintenance
|
| 204 |
+
|
| 205 |
+
1. Logs:
|
| 206 |
+
- Application logs: `logs/app.log`
|
| 207 |
+
- Error logs: `logs/error.log`
|
| 208 |
+
- Access logs: `logs/access.log`
|
| 209 |
+
|
| 210 |
+
2. Health Checks:
|
| 211 |
+
- API endpoint: `/health`
|
| 212 |
+
- Database status
|
| 213 |
+
- Service status
|
| 214 |
|
| 215 |
+
3. Backup:
|
| 216 |
+
- Regular database backups
|
| 217 |
+
- Configuration backups
|
| 218 |
+
- Log rotation
|
| 219 |
+
|
| 220 |
+
## Troubleshooting
|
| 221 |
+
|
| 222 |
+
1. Common Issues:
|
| 223 |
+
- Database connection errors
|
| 224 |
+
- API key validation failures
|
| 225 |
+
- Webhook delivery failures
|
| 226 |
+
|
| 227 |
+
2. Solutions:
|
| 228 |
+
- Check database credentials
|
| 229 |
+
- Verify API key
|
| 230 |
+
- Test webhook endpoint
|
| 231 |
+
- Review error logs
|
| 232 |
|
| 233 |
## Support
|
| 234 |
|
| 235 |
+
For support:
|
| 236 |
+
- Email: support@vbot.com
|
| 237 |
+
- Documentation: https://vbot.com/docs
|
| 238 |
+
- GitHub Issues: https://github.com/vbot/issues
|
| 239 |
|
| 240 |
## License
|
| 241 |
|
| 242 |
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
| 243 |
+
|
| 244 |
+
## Documentation
|
| 245 |
+
|
| 246 |
+
- [Setup Guide](SETUP_GUIDE.md) - Detailed setup instructions
|
| 247 |
+
- [User Manual](USER_MANUAL.md) - End-user documentation
|
| 248 |
+
- [API Documentation](API_DOCS.md) - API reference and examples
|
| 249 |
+
|
| 250 |
+
## Architecture
|
| 251 |
+
|
| 252 |
+
vBot follows a modern API-first architecture:
|
| 253 |
|
| 254 |
+
1. **Core Components**:
|
| 255 |
+
- FastAPI backend
|
| 256 |
+
- MySQL database
|
| 257 |
+
- Hugging Face AI models
|
| 258 |
+
- Asterisk integration
|
| 259 |
+
|
| 260 |
+
2. **Data Flow**:
|
| 261 |
+
- Calls are received by Asterisk
|
| 262 |
+
- Audio is processed by vBot
|
| 263 |
+
- Results are stored and accessible via API
|
| 264 |
+
- Customers access data through their API keys
|
| 265 |
+
|
| 266 |
+
3. **Security**:
|
| 267 |
+
- JWT-based authentication for admin
|
| 268 |
+
- API key authentication for customers
|
| 269 |
+
- Secure data isolation between customers
|
| 270 |
+
|
| 271 |
+
## Contributing
|
| 272 |
+
|
| 273 |
+
1. Fork the repository
|
| 274 |
+
2. Create your feature branch
|
| 275 |
+
3. Commit your changes
|
| 276 |
+
4. Push to the branch
|
| 277 |
+
5. Create a Pull Request
|
| 278 |
+
|
| 279 |
+
## API Endpoints
|
| 280 |
+
|
| 281 |
+
### Admin Endpoints
|
| 282 |
+
- `
|