Ajit Panday commited on
Commit
3a6a328
Β·
1 Parent(s): dd5293b

Consolidate all documentation into README.md

Browse files
Files changed (1) hide show
  1. README.md +246 -47
README.md CHANGED
@@ -9,75 +9,274 @@ app_file: main.py
9
  pinned: false
10
  ---
11
 
12
- # vBot - AI-Powered Call Analysis System
13
 
14
- vBot is a multi-tenant system that provides AI-powered call analysis for Asterisk PBX systems. It processes phone conversations to provide transcription, summarization, and sentiment analysis using Hugging Face models.
15
 
16
  ## Features
17
 
18
- - 🎯 Multi-tenant support with secure API keys
19
- - πŸŽ™οΈ Real-time call processing
20
- - πŸ“ Speech-to-text transcription
21
- - πŸ“‹ Call summarization
22
- - 😊 Sentiment analysis
23
- - πŸ”’ Secure admin dashboard
24
- - πŸ”Œ RESTful API
 
 
 
 
 
 
 
 
25
 
26
  ## Quick Start
27
 
28
- 1. **Deploy to Hugging Face Spaces**
29
- - Click "Use this Space"
30
- - Configure environment variables
31
- - Deploy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- 2. **Set Up Database**
34
- - Sign up for a free MySQL hosting service:
35
- - [PlanetScale](https://planetscale.com/) (Recommended)
36
- - [Railway](https://railway.app/)
37
- - [Clever Cloud](https://www.clever-cloud.com/)
38
- - Create a new MySQL database
39
- - Get your database connection URL
 
40
 
41
- 3. **Configure Environment Variables**
42
  ```bash
43
- # Generate a secure JWT secret
44
- python3 -c "import secrets; print(secrets.token_urlsafe(32))"
 
 
 
 
 
45
 
46
- # Set these environment variables in your Space settings
47
- JWT_SECRET=<generated-secret>
48
- ADMIN_USERNAME=your-admin-username
49
- ADMIN_PASSWORD=your-secure-password
50
- DATABASE_URL=mysql+pymysql://username:password@host:port/database
 
 
 
 
 
 
 
51
  ```
52
 
53
- 4. **Integration with Asterisk**
54
- - Get your API key from the admin dashboard
55
- - Configure your Asterisk dialplan
56
- - Start processing calls
57
 
58
- ## Documentation
59
 
60
- For detailed documentation, please refer to our [User Manual](USER_MANUAL.md).
 
 
 
 
 
 
 
 
61
 
62
- ## API Endpoints
 
 
 
 
 
 
 
 
 
 
 
63
 
64
- ### Admin Endpoints
65
- - `POST /api/v1/token` - Get admin token
66
- - `POST /api/v1/customers/` - Create customer
67
- - `GET /api/v1/customers/` - List customers
68
- - `GET /api/v1/customers/{id}` - Get customer
69
- - `DELETE /api/v1/customers/{id}` - Delete customer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
- ### Customer Endpoints
72
- - `POST /api/v1/process-call` - Process call
73
- - `GET /api/v1/calls/{id}` - List calls
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
  ## Support
76
 
77
- For support and troubleshooting, please refer to the [Troubleshooting Guide](USER_MANUAL.md#troubleshooting) in our user manual.
 
 
 
78
 
79
  ## License
80
 
81
- MIT License
 
 
 
 
 
 
 
 
 
 
82
 
83
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - `