Ajit Panday commited on
Commit
821422c
·
1 Parent(s): fa064b6

Update documentation for vBot-2.1

Browse files
Files changed (2) hide show
  1. README.md +2 -4
  2. SETUP_GUIDE.md +35 -205
README.md CHANGED
@@ -11,7 +11,7 @@ pinned: false
11
 
12
  # vBot - Intelligent Call Analysis System
13
 
14
- vBot is a distributed call analysis system where a central server ONLY handles AI-powered transcription and analysis, while each customer maintains their own complete infrastructure (FreePBX, database, web server) and receives results via webhooks.
15
 
16
  ## System Architecture
17
 
@@ -27,9 +27,8 @@ vBot is a distributed call analysis system where a central server ONLY handles A
27
 
28
  ### Customer Infrastructure (Remote)
29
  Each customer maintains their own complete system:
30
- - FreePBX server (includes Asterisk, web server, and database)
31
  - MySQL database (included with FreePBX)
32
- - Web server (Apache included with FreePBX)
33
  - SSL certificate for secure webhooks
34
  - Complete control over their data and infrastructure
35
  - Full ownership of their call recordings
@@ -56,7 +55,6 @@ Each customer maintains their own complete system:
56
  - FreePBX 16 or higher
57
  - PHP 7.4 or higher
58
  - MySQL 5.7 or higher (included with FreePBX)
59
- - Apache web server (included with FreePBX)
60
  - SSL certificate for secure webhooks
61
 
62
  ## Quick Start
 
11
 
12
  # vBot - Intelligent Call Analysis System
13
 
14
+ vBot is a distributed call analysis system where a central server ONLY handles AI-powered transcription and analysis, while each customer maintains their own complete infrastructure (FreePBX, database) and receives results via webhooks.
15
 
16
  ## System Architecture
17
 
 
27
 
28
  ### Customer Infrastructure (Remote)
29
  Each customer maintains their own complete system:
30
+ - FreePBX server (includes Asterisk, Apache web server, and database)
31
  - MySQL database (included with FreePBX)
 
32
  - SSL certificate for secure webhooks
33
  - Complete control over their data and infrastructure
34
  - Full ownership of their call recordings
 
55
  - FreePBX 16 or higher
56
  - PHP 7.4 or higher
57
  - MySQL 5.7 or higher (included with FreePBX)
 
58
  - SSL certificate for secure webhooks
59
 
60
  ## Quick Start
SETUP_GUIDE.md CHANGED
@@ -60,93 +60,41 @@ This guide provides detailed instructions for setting up both the central vBot s
60
 
61
  ## Customer Infrastructure Setup
62
 
63
- ### 1. Asterisk Server Setup
64
 
65
- 1. Install Asterisk:
66
- ```bash
67
- sudo apt update
68
- sudo apt install asterisk
69
- ```
70
-
71
- 2. Configure dialplan:
72
- ```ini
73
- [from-internal]
74
- exten => _X.,1,Answer()
75
- same => n,Record(/tmp/calls/${UNIQUEID}.wav,0,0)
76
- same => n,Set(CALL_ID=${UNIQUEID})
77
- same => n,Set(CALLER=${CALLERID(num)})
78
- same => n,Set(CALLED=${EXTEN})
79
- same => n,AGI(agi://localhost:4573/process_call)
80
- same => n,Hangup()
81
- ```
82
-
83
- 3. Configure AGI script:
84
- ```bash
85
- sudo nano /etc/asterisk/agi-bin/process_call
86
- ```
87
- ```bash
88
- #!/bin/bash
89
- CALL_ID=$1
90
- CALLER=$2
91
- CALLED=$3
92
-
93
- curl -X POST https://vbot-server.com/api/process-call \
94
- -H "X-API-Key: your_api_key" \
95
- -H "Content-Type: multipart/form-data" \
96
- -F "file=@/tmp/calls/${CALL_ID}.wav" \
97
- -H "caller_number=${CALLER}" \
98
- -H "called_number=${CALLED}"
99
- ```
100
-
101
- 4. Set permissions:
102
- ```bash
103
- sudo chmod +x /etc/asterisk/agi-bin/process_call
104
- sudo chown asterisk:asterisk /etc/asterisk/agi-bin/process_call
105
- ```
106
-
107
- 5. Restart Asterisk:
108
- ```bash
109
- sudo systemctl restart asterisk
110
- ```
111
 
112
- ### 2. Web Server Setup
 
 
 
 
113
 
114
- 1. Install Apache:
115
  ```bash
116
- sudo apt install apache2 php php-mysql
117
- ```
118
-
119
- 2. Configure virtual host:
120
- ```apache
121
- <VirtualHost *:80>
122
- ServerName your-domain.com
123
- DocumentRoot /var/www/html/vbot-webhook
124
-
125
- <Directory /var/www/html/vbot-webhook>
126
- Options Indexes FollowSymLinks
127
- AllowOverride All
128
- Require all granted
129
- </Directory>
130
-
131
- ErrorLog ${APACHE_LOG_DIR}/vbot-error.log
132
- CustomLog ${APACHE_LOG_DIR}/vbot-access.log combined
133
- </VirtualHost>
134
  ```
135
 
136
- 3. Enable SSL:
137
- ```bash
138
- sudo apt install certbot python3-certbot-apache
139
- sudo certbot --apache -d your-domain.com
140
- ```
141
 
142
- ### 3. Database Setup
 
 
 
143
 
144
- 1. Install MySQL:
145
- ```bash
146
- sudo apt install mysql-server
147
- ```
148
 
149
- 2. Create database:
150
  ```sql
151
  CREATE DATABASE vbot_calls;
152
  USE vbot_calls;
@@ -165,22 +113,16 @@ This guide provides detailed instructions for setting up both the central vBot s
165
  );
166
  ```
167
 
168
- 3. Create database user:
169
  ```sql
170
  CREATE USER 'vbot_user'@'localhost' IDENTIFIED BY 'your_password';
171
  GRANT ALL PRIVILEGES ON vbot_calls.* TO 'vbot_user'@'localhost';
172
  FLUSH PRIVILEGES;
173
  ```
174
 
175
- ### 4. Webhook Handler Setup
176
 
177
- 1. Download webhook handler:
178
- ```bash
179
- git clone https://huggingface.co/spaces/iajitpanday/vBot/customer_webhook
180
- sudo cp -r customer_webhook/* /var/www/html/vbot-webhook/
181
- ```
182
-
183
- 2. Configure webhook handler:
184
  ```bash
185
  sudo cp /var/www/html/vbot-webhook/config/config.example.php /var/www/html/vbot-webhook/config/config.php
186
  sudo nano /var/www/html/vbot-webhook/config/config.php
@@ -198,13 +140,13 @@ This guide provides detailed instructions for setting up both the central vBot s
198
  ];
199
  ```
200
 
201
- 3. Set permissions:
202
  ```bash
203
  sudo chown -R www-data:www-data /var/www/html/vbot-webhook
204
  sudo chmod -R 755 /var/www/html/vbot-webhook
205
  ```
206
 
207
- ### 5. Testing Setup
208
 
209
  1. Test webhook endpoint:
210
  ```bash
@@ -256,7 +198,7 @@ This guide provides detailed instructions for setting up both the central vBot s
256
 
257
  1. Log Monitoring:
258
  ```bash
259
- # Asterisk logs
260
  tail -f /var/log/asterisk/messages
261
 
262
  # Webhook logs
@@ -303,7 +245,7 @@ This guide provides detailed instructions for setting up both the central vBot s
303
  cd /var/www/html/vbot-webhook
304
  git pull
305
 
306
- # Update Asterisk
307
  sudo apt update
308
  sudo apt upgrade
309
  ```
@@ -321,7 +263,7 @@ This guide provides detailed instructions for setting up both the central vBot s
321
  # Check webhook logs
322
  tail -f /var/log/apache2/vbot-error.log
323
 
324
- # Check Asterisk CLI
325
  sudo asterisk -rx "core show version"
326
 
327
  # Test database connection
@@ -332,116 +274,4 @@ This guide provides detailed instructions for setting up both the central vBot s
332
  - Check documentation
333
  - Review logs
334
  - Contact support
335
- - Submit issues
336
-
337
- ## Step 1: Deploy to Hugging Face Spaces
338
- 1. Create a Hugging Face account if you don't have one
339
- 2. Create a new Space
340
- 3. Configure environment variables:
341
- - `DATABASE_URL`: Your MySQL database connection string
342
- - `SECRET_KEY`: A secure random string for JWT token generation
343
- - `API_BASE_URL`: The base URL of your vBot API
344
-
345
- ## Step 2: Customer Setup (FreePBX)
346
- 1. Install FreePBX:
347
- - Download FreePBX 16 or higher
348
- - Follow the installation guide
349
- - Complete the setup wizard
350
- - Ensure all components are properly configured
351
-
352
- 2. Configure FreePBX:
353
- - Enable call recording in FreePBX Admin
354
- - Set up recording paths
355
- - Configure recording formats
356
- - Set up SSL certificates
357
-
358
- 3. Install the customer webhook package:
359
- ```bash
360
- git clone https://huggingface.co/spaces/iajitpanday/vBot
361
- cd vBot/customer_webhook
362
- composer install
363
- cp config/config.example.php config/config.php
364
- ```
365
-
366
- 4. Configure the webhook package:
367
- - Update `config/config.php` with FreePBX database details
368
- - Set the vBot API URL and your API key
369
- - Configure the webhook endpoint
370
-
371
- 5. Set up FreePBX integration:
372
- - Configure FreePBX to use the webhook endpoint
373
- - Set up recording post-processing
374
- - Configure SSL for secure communication
375
-
376
- ## Step 3: Testing
377
- 1. Test FreePBX recording:
378
- - Make a test call
379
- - Verify recording is created
380
- - Check recording quality
381
-
382
- 2. Test webhook integration:
383
- - Monitor webhook delivery
384
- - Verify data format
385
- - Check error handling
386
-
387
- 3. Test API connection:
388
- - Verify API key authentication
389
- - Test call processing
390
- - Check result delivery
391
-
392
- ## Step 4: Production Deployment
393
- 1. Security:
394
- - Enable SSL for all communications
395
- - Set up proper firewall rules
396
- - Configure secure API keys
397
- - Implement rate limiting
398
-
399
- 2. Performance:
400
- - Optimize FreePBX recording settings
401
- - Configure proper storage
402
- - Set up monitoring
403
- - Implement backup strategy
404
-
405
- 3. Monitoring:
406
- - Set up FreePBX monitoring
407
- - Monitor webhook delivery
408
- - Track API usage
409
- - Monitor system resources
410
-
411
- ## Step 5: Maintenance
412
- 1. Regular Tasks:
413
- - Monitor system logs
414
- - Check recording storage
415
- - Verify webhook delivery
416
- - Update security certificates
417
-
418
- 2. Backup:
419
- - Backup FreePBX configuration
420
- - Backup recordings
421
- - Backup webhook configuration
422
- - Test restore procedures
423
-
424
- 3. Updates:
425
- - Keep FreePBX updated
426
- - Update webhook package
427
- - Update SSL certificates
428
- - Test updates in staging
429
-
430
- ## Troubleshooting
431
- 1. Common Issues:
432
- - Recording not created
433
- - Webhook delivery failed
434
- - API connection issues
435
- - Performance problems
436
-
437
- 2. Solutions:
438
- - Check FreePBX logs
439
- - Verify webhook configuration
440
- - Test API connection
441
- - Monitor system resources
442
-
443
- 3. Support:
444
- - Contact support
445
- - Submit issues
446
- - Check documentation
447
- - Join community forums
 
60
 
61
  ## Customer Infrastructure Setup
62
 
63
+ ### 1. FreePBX Setup
64
 
65
+ 1. Install FreePBX:
66
+ - Download FreePBX 16 or higher
67
+ - Follow the installation guide
68
+ - Complete the setup wizard
69
+ - Ensure all components are properly configured
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ 2. Configure FreePBX:
72
+ - Enable call recording in FreePBX Admin
73
+ - Set up recording paths
74
+ - Configure recording formats
75
+ - Set up SSL certificates
76
 
77
+ 3. Install the customer webhook package:
78
  ```bash
79
+ git clone https://huggingface.co/spaces/iajitpanday/vBot
80
+ cd vBot/customer_webhook
81
+ composer install
82
+ cp config/config.example.php config/config.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  ```
84
 
85
+ 4. Configure the webhook package:
86
+ - Update `config/config.php` with FreePBX database details
87
+ - Set the vBot API URL and your API key
88
+ - Configure the webhook endpoint
 
89
 
90
+ 5. Set up FreePBX integration:
91
+ - Configure FreePBX to use the webhook endpoint
92
+ - Set up recording post-processing
93
+ - Configure SSL for secure communication
94
 
95
+ ### 2. Database Setup
 
 
 
96
 
97
+ 1. Create database:
98
  ```sql
99
  CREATE DATABASE vbot_calls;
100
  USE vbot_calls;
 
113
  );
114
  ```
115
 
116
+ 2. Create database user:
117
  ```sql
118
  CREATE USER 'vbot_user'@'localhost' IDENTIFIED BY 'your_password';
119
  GRANT ALL PRIVILEGES ON vbot_calls.* TO 'vbot_user'@'localhost';
120
  FLUSH PRIVILEGES;
121
  ```
122
 
123
+ ### 3. Webhook Handler Setup
124
 
125
+ 1. Configure webhook handler:
 
 
 
 
 
 
126
  ```bash
127
  sudo cp /var/www/html/vbot-webhook/config/config.example.php /var/www/html/vbot-webhook/config/config.php
128
  sudo nano /var/www/html/vbot-webhook/config/config.php
 
140
  ];
141
  ```
142
 
143
+ 2. Set permissions:
144
  ```bash
145
  sudo chown -R www-data:www-data /var/www/html/vbot-webhook
146
  sudo chmod -R 755 /var/www/html/vbot-webhook
147
  ```
148
 
149
+ ### 4. Testing Setup
150
 
151
  1. Test webhook endpoint:
152
  ```bash
 
198
 
199
  1. Log Monitoring:
200
  ```bash
201
+ # FreePBX logs
202
  tail -f /var/log/asterisk/messages
203
 
204
  # Webhook logs
 
245
  cd /var/www/html/vbot-webhook
246
  git pull
247
 
248
+ # Update FreePBX
249
  sudo apt update
250
  sudo apt upgrade
251
  ```
 
263
  # Check webhook logs
264
  tail -f /var/log/apache2/vbot-error.log
265
 
266
+ # Check FreePBX CLI
267
  sudo asterisk -rx "core show version"
268
 
269
  # Test database connection
 
274
  - Check documentation
275
  - Review logs
276
  - Contact support
277
+ - Submit issues