Spaces:
Sleeping
Sleeping
Ajit Panday
commited on
Commit
·
561ef55
1
Parent(s):
a46907b
Update documentation to reflect simplified API-based architecture
Browse files- SETUP_GUIDE.md +87 -149
- USER_MANUAL.md +203 -191
SETUP_GUIDE.md
CHANGED
|
@@ -1,238 +1,176 @@
|
|
| 1 |
# vBot Setup Guide
|
| 2 |
|
|
|
|
|
|
|
| 3 |
## Step 1: Deploy to Hugging Face Spaces
|
| 4 |
|
| 5 |
-
1. **Create Hugging Face Account**
|
| 6 |
-
- Go to https://huggingface.co
|
| 7 |
- Sign up for a free account
|
| 8 |
-
-
|
| 9 |
|
| 10 |
2. **Deploy the Space**
|
| 11 |
-
- Visit https://huggingface.co/spaces/iajitpanday/vBot
|
| 12 |
- Click "Use this Space"
|
| 13 |
-
- Choose
|
| 14 |
-
-
|
|
|
|
| 15 |
|
| 16 |
3. **Configure Environment Variables**
|
| 17 |
```bash
|
| 18 |
# Generate a secure JWT secret
|
| 19 |
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
| 20 |
|
| 21 |
-
# Set these in your Space settings
|
| 22 |
JWT_SECRET=<generated-secret>
|
| 23 |
ADMIN_USERNAME=your-admin-username
|
| 24 |
ADMIN_PASSWORD=your-secure-password
|
| 25 |
-
DATABASE_URL=mysql+pymysql://username:password@host:port/
|
| 26 |
```
|
| 27 |
|
| 28 |
## Step 2: Set Up Main Database
|
| 29 |
|
| 30 |
-
1. **
|
| 31 |
-
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
- Get your database connection URL
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
mysql -h your-host -u your-user -p your-password
|
| 42 |
-
```
|
| 43 |
|
| 44 |
## Step 3: Admin Setup
|
| 45 |
|
| 46 |
1. **Access Admin Dashboard**
|
| 47 |
- Go to your Space URL
|
| 48 |
-
-
|
| 49 |
-
-
|
| 50 |
-
- Save the JWT token
|
| 51 |
|
| 52 |
2. **Create First Customer**
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
"db_port": 3306,
|
| 61 |
-
"db_name": "acme_calls",
|
| 62 |
-
"db_user": "acme_user",
|
| 63 |
-
"db_password": "acme_password"
|
| 64 |
-
}
|
| 65 |
-
```
|
| 66 |
-
|
| 67 |
-
3. **Save Customer API Key**
|
| 68 |
-
- Note down the API key from the response
|
| 69 |
-
- Share it securely with the customer
|
| 70 |
|
| 71 |
## Step 4: Customer Setup
|
| 72 |
|
| 73 |
-
1. **
|
| 74 |
-
-
|
| 75 |
-
-
|
| 76 |
-
-
|
| 77 |
-
|
| 78 |
-
2. **Configure Asterisk**
|
| 79 |
-
```ini
|
| 80 |
-
# /etc/asterisk/dialplan/vbot.conf
|
| 81 |
-
[from-internal]
|
| 82 |
-
exten => _X.,1,Answer()
|
| 83 |
-
same => n,Set(CALLERID=${CALLERID(num)})
|
| 84 |
-
same => n,Set(CALLED=${EXTEN})
|
| 85 |
-
same => n,Record(/tmp/call-${UNIQUEID}.wav,0,30)
|
| 86 |
-
same => n,System(curl -X POST "https://your-huggingface-space-url/api/v1/process-call" \
|
| 87 |
-
-H "api-key: YOUR_API_KEY" \
|
| 88 |
-
-H "caller-number: ${CALLERID}" \
|
| 89 |
-
-H "called-number: ${CALLED}" \
|
| 90 |
-
-F "file=@/tmp/call-${UNIQUEID}.wav")
|
| 91 |
-
same => n,System(rm /tmp/call-${UNIQUEID}.wav)
|
| 92 |
-
same => n,Dial(SIP/${EXTEN})
|
| 93 |
-
same => n,Hangup()
|
| 94 |
-
```
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
# Add this line
|
| 101 |
-
#include vbot.conf
|
| 102 |
-
|
| 103 |
-
# Reload Asterisk
|
| 104 |
-
asterisk -rx "dialplan reload"
|
| 105 |
-
```
|
| 106 |
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
-H "api-key: YOUR_API_KEY" \
|
| 112 |
-
-H "Content-Type: application/json"
|
| 113 |
-
|
| 114 |
-
# Get specific call details
|
| 115 |
-
curl -X GET "https://your-huggingface-space-url/api/v1/calls/{call_id}" \
|
| 116 |
-
-H "api-key: YOUR_API_KEY" \
|
| 117 |
-
-H "Content-Type: application/json"
|
| 118 |
-
|
| 119 |
-
# Search calls
|
| 120 |
-
curl -X GET "https://your-huggingface-space-url/api/v1/calls/search" \
|
| 121 |
-
-H "api-key: YOUR_API_KEY" \
|
| 122 |
-
-H "Content-Type: application/json" \
|
| 123 |
-
-d '{
|
| 124 |
-
"start_date": "2024-01-01",
|
| 125 |
-
"end_date": "2024-01-31",
|
| 126 |
-
"caller_number": "+1234567890"
|
| 127 |
-
}'
|
| 128 |
-
```
|
| 129 |
|
| 130 |
## Step 5: Testing
|
| 131 |
|
| 132 |
1. **Test API Connection**
|
| 133 |
```bash
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
-H "caller-number: +1234567890" \
|
| 138 |
-
-H "called-number: +0987654321" \
|
| 139 |
-
-F "file=@test.wav"
|
| 140 |
```
|
| 141 |
|
| 142 |
2. **Test Call Processing**
|
| 143 |
-
- Make a test call
|
| 144 |
-
- Check
|
| 145 |
-
- Verify transcription
|
| 146 |
|
| 147 |
3. **Monitor Logs**
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
# Check Hugging Face Space logs
|
| 153 |
-
# View logs in Space settings
|
| 154 |
-
```
|
| 155 |
|
| 156 |
## Step 6: Production Deployment
|
| 157 |
|
| 158 |
1. **Security Checklist**
|
| 159 |
-
- [ ]
|
| 160 |
-
- [ ]
|
| 161 |
-
- [ ]
|
| 162 |
-
- [ ]
|
| 163 |
-
- [ ]
|
| 164 |
|
| 165 |
2. **Performance Optimization**
|
| 166 |
-
-
|
| 167 |
-
-
|
| 168 |
-
-
|
| 169 |
-
- [ ] Configure caching
|
| 170 |
|
| 171 |
3. **Monitoring Setup**
|
| 172 |
-
-
|
| 173 |
-
-
|
| 174 |
-
-
|
| 175 |
-
- [ ] Monitor disk space
|
| 176 |
|
| 177 |
## Step 7: Maintenance
|
| 178 |
|
| 179 |
1. **Regular Tasks**
|
| 180 |
-
- Monitor system
|
| 181 |
-
- Check
|
| 182 |
- Update dependencies
|
| 183 |
-
- Backup
|
| 184 |
|
| 185 |
2. **Customer Management**
|
| 186 |
-
-
|
| 187 |
-
- Monitor database sizes
|
| 188 |
- Handle customer requests
|
| 189 |
- Update customer configurations
|
| 190 |
|
| 191 |
3. **System Updates**
|
| 192 |
-
-
|
| 193 |
-
-
|
| 194 |
-
-
|
| 195 |
-
- Monitor security patches
|
| 196 |
|
| 197 |
## Troubleshooting
|
| 198 |
|
| 199 |
1. **Common Issues**
|
| 200 |
-
-
|
| 201 |
-
-
|
| 202 |
-
-
|
| 203 |
-
-
|
| 204 |
|
| 205 |
2. **Solutions**
|
| 206 |
-
- Check
|
| 207 |
- Verify database credentials
|
| 208 |
-
- Monitor
|
| 209 |
-
-
|
| 210 |
|
| 211 |
3. **Support**
|
| 212 |
-
- Check
|
| 213 |
-
- Review
|
| 214 |
-
- Contact
|
| 215 |
-
- Consult documentation
|
| 216 |
|
| 217 |
## Best Practices
|
| 218 |
|
| 219 |
1. **Security**
|
| 220 |
-
- Rotate API keys regularly
|
| 221 |
- Use strong passwords
|
| 222 |
-
-
|
| 223 |
- Monitor access logs
|
|
|
|
| 224 |
|
| 225 |
2. **Performance**
|
| 226 |
-
- Optimize database queries
|
| 227 |
- Monitor resource usage
|
| 228 |
-
-
|
| 229 |
-
-
|
|
|
|
| 230 |
|
| 231 |
3. **Reliability**
|
| 232 |
- Regular backups
|
| 233 |
- Monitor system health
|
| 234 |
-
-
|
| 235 |
-
-
|
| 236 |
|
| 237 |
## Database Schema Setup
|
| 238 |
|
|
|
|
| 1 |
# vBot Setup Guide
|
| 2 |
|
| 3 |
+
This guide provides detailed instructions for setting up and deploying the vBot system.
|
| 4 |
+
|
| 5 |
## Step 1: Deploy to Hugging Face Spaces
|
| 6 |
|
| 7 |
+
1. **Create a Hugging Face Account**
|
| 8 |
+
- Go to [Hugging Face](https://huggingface.co)
|
| 9 |
- Sign up for a free account
|
| 10 |
+
- Create a new Space
|
| 11 |
|
| 12 |
2. **Deploy the Space**
|
|
|
|
| 13 |
- Click "Use this Space"
|
| 14 |
+
- Choose "Docker" as the SDK
|
| 15 |
+
- Select "FastAPI" as the framework
|
| 16 |
+
- Deploy the space
|
| 17 |
|
| 18 |
3. **Configure Environment Variables**
|
| 19 |
```bash
|
| 20 |
# Generate a secure JWT secret
|
| 21 |
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
| 22 |
|
| 23 |
+
# Set these environment variables in your Space settings
|
| 24 |
JWT_SECRET=<generated-secret>
|
| 25 |
ADMIN_USERNAME=your-admin-username
|
| 26 |
ADMIN_PASSWORD=your-secure-password
|
| 27 |
+
DATABASE_URL=mysql+pymysql://username:password@host:port/database
|
| 28 |
```
|
| 29 |
|
| 30 |
## Step 2: Set Up Main Database
|
| 31 |
|
| 32 |
+
1. **Choose a Database Provider**
|
| 33 |
+
- [PlanetScale](https://planetscale.com/) (Recommended)
|
| 34 |
+
- [Railway](https://railway.app/)
|
| 35 |
+
- [Clever Cloud](https://www.clever-cloud.com/)
|
| 36 |
+
|
| 37 |
+
2. **Create Database**
|
| 38 |
+
- Sign up for an account
|
| 39 |
+
- Create a new MySQL database
|
| 40 |
- Get your database connection URL
|
| 41 |
+
- Update the `DATABASE_URL` environment variable
|
| 42 |
|
| 43 |
+
3. **Verify Database Connection**
|
| 44 |
+
- The application will automatically create necessary tables
|
| 45 |
+
- Check the logs for any connection issues
|
|
|
|
|
|
|
| 46 |
|
| 47 |
## Step 3: Admin Setup
|
| 48 |
|
| 49 |
1. **Access Admin Dashboard**
|
| 50 |
- Go to your Space URL
|
| 51 |
+
- Click "Admin Login"
|
| 52 |
+
- Use your admin credentials
|
|
|
|
| 53 |
|
| 54 |
2. **Create First Customer**
|
| 55 |
+
- Click "Add New Customer"
|
| 56 |
+
- Fill in customer details:
|
| 57 |
+
- Name
|
| 58 |
+
- Company Name
|
| 59 |
+
- Email
|
| 60 |
+
- Save the customer
|
| 61 |
+
- Copy the generated API key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
## Step 4: Customer Setup
|
| 64 |
|
| 65 |
+
1. **Configure Asterisk**
|
| 66 |
+
- Install Asterisk if not already installed
|
| 67 |
+
- Configure your dialplan
|
| 68 |
+
- Set up call recording
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
+
2. **Update Asterisk Configuration**
|
| 71 |
+
- Add the vBot dialplan configuration
|
| 72 |
+
- Configure the API endpoint
|
| 73 |
+
- Set up the API key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
+
3. **Test Integration**
|
| 76 |
+
- Make a test call
|
| 77 |
+
- Verify call recording
|
| 78 |
+
- Check API responses
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
## Step 5: Testing
|
| 81 |
|
| 82 |
1. **Test API Connection**
|
| 83 |
```bash
|
| 84 |
+
curl -X POST "https://your-space.huggingface.space/api/v1/token" \
|
| 85 |
+
-H "Content-Type: application/x-www-form-urlencoded" \
|
| 86 |
+
-d "username=admin&password=your-password"
|
|
|
|
|
|
|
|
|
|
| 87 |
```
|
| 88 |
|
| 89 |
2. **Test Call Processing**
|
| 90 |
+
- Make a test call
|
| 91 |
+
- Check the logs for processing status
|
| 92 |
+
- Verify transcription and analysis
|
| 93 |
|
| 94 |
3. **Monitor Logs**
|
| 95 |
+
- Check Space logs for errors
|
| 96 |
+
- Monitor database connections
|
| 97 |
+
- Verify API responses
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
## Step 6: Production Deployment
|
| 100 |
|
| 101 |
1. **Security Checklist**
|
| 102 |
+
- [ ] Secure JWT secret
|
| 103 |
+
- [ ] Strong admin password
|
| 104 |
+
- [ ] HTTPS enabled
|
| 105 |
+
- [ ] API keys properly configured
|
| 106 |
+
- [ ] Database credentials secured
|
| 107 |
|
| 108 |
2. **Performance Optimization**
|
| 109 |
+
- Configure database connection pooling
|
| 110 |
+
- Set up caching if needed
|
| 111 |
+
- Monitor resource usage
|
|
|
|
| 112 |
|
| 113 |
3. **Monitoring Setup**
|
| 114 |
+
- Enable Space monitoring
|
| 115 |
+
- Set up database monitoring
|
| 116 |
+
- Configure alerting
|
|
|
|
| 117 |
|
| 118 |
## Step 7: Maintenance
|
| 119 |
|
| 120 |
1. **Regular Tasks**
|
| 121 |
+
- Monitor system logs
|
| 122 |
+
- Check database performance
|
| 123 |
- Update dependencies
|
| 124 |
+
- Backup data
|
| 125 |
|
| 126 |
2. **Customer Management**
|
| 127 |
+
- Monitor customer usage
|
|
|
|
| 128 |
- Handle customer requests
|
| 129 |
- Update customer configurations
|
| 130 |
|
| 131 |
3. **System Updates**
|
| 132 |
+
- Keep dependencies updated
|
| 133 |
+
- Monitor for security patches
|
| 134 |
+
- Plan for feature updates
|
|
|
|
| 135 |
|
| 136 |
## Troubleshooting
|
| 137 |
|
| 138 |
1. **Common Issues**
|
| 139 |
+
- Database connection errors
|
| 140 |
+
- API authentication issues
|
| 141 |
+
- Call processing failures
|
| 142 |
+
- Performance problems
|
| 143 |
|
| 144 |
2. **Solutions**
|
| 145 |
+
- Check environment variables
|
| 146 |
- Verify database credentials
|
| 147 |
+
- Monitor system logs
|
| 148 |
+
- Test API endpoints
|
| 149 |
|
| 150 |
3. **Support**
|
| 151 |
+
- Check documentation
|
| 152 |
+
- Review logs
|
| 153 |
+
- Contact support if needed
|
|
|
|
| 154 |
|
| 155 |
## Best Practices
|
| 156 |
|
| 157 |
1. **Security**
|
|
|
|
| 158 |
- Use strong passwords
|
| 159 |
+
- Rotate API keys regularly
|
| 160 |
- Monitor access logs
|
| 161 |
+
- Keep systems updated
|
| 162 |
|
| 163 |
2. **Performance**
|
|
|
|
| 164 |
- Monitor resource usage
|
| 165 |
+
- Optimize database queries
|
| 166 |
+
- Cache frequently accessed data
|
| 167 |
+
- Scale resources as needed
|
| 168 |
|
| 169 |
3. **Reliability**
|
| 170 |
- Regular backups
|
| 171 |
- Monitor system health
|
| 172 |
+
- Test failover procedures
|
| 173 |
+
- Document procedures
|
| 174 |
|
| 175 |
## Database Schema Setup
|
| 176 |
|
USER_MANUAL.md
CHANGED
|
@@ -1,224 +1,236 @@
|
|
| 1 |
# vBot User Manual
|
| 2 |
|
|
|
|
|
|
|
| 3 |
## Table of Contents
|
| 4 |
-
1. [
|
| 5 |
-
2. [
|
| 6 |
-
3. [
|
| 7 |
-
4. [
|
| 8 |
-
5. [Usage](#usage)
|
| 9 |
-
6. [
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
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.
|
| 14 |
|
| 15 |
### Key Features
|
| 16 |
-
-
|
| 17 |
-
- Real-time call processing
|
| 18 |
-
- Speech-to-text transcription
|
| 19 |
-
- Call summarization
|
| 20 |
- Sentiment analysis
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
-
|
| 30 |
-
-
|
| 31 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
###
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
-
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
-
In your Hugging Face Space settings, add the following environment variables:
|
| 48 |
```bash
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
ADMIN_PASSWORD=your-secure-password
|
| 52 |
-
DATABASE_URL=mysql+pymysql://username:password@host:port/database
|
| 53 |
```
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
## Configuration
|
| 60 |
-
|
| 61 |
-
### 1. Admin Setup
|
| 62 |
-
1. Log in to the admin dashboard using your credentials
|
| 63 |
-
2. Navigate to the Customers section
|
| 64 |
-
3. Create new customers by providing:
|
| 65 |
-
- Company name
|
| 66 |
-
- Contact person name
|
| 67 |
-
- Email address
|
| 68 |
-
4. Save the generated API key for each customer
|
| 69 |
-
|
| 70 |
-
### 2. Asterisk Integration
|
| 71 |
-
1. Copy the sample dialplan configuration:
|
| 72 |
-
```ini
|
| 73 |
-
[from-internal]
|
| 74 |
-
exten => _X.,1,Answer()
|
| 75 |
-
same => n,Set(CALLERID=${CALLERID(num)})
|
| 76 |
-
same => n,Set(CALLED=${EXTEN})
|
| 77 |
-
same => n,Record(/tmp/call-${UNIQUEID}.wav,0,30)
|
| 78 |
-
same => n,System(curl -X POST "https://your-huggingface-space-url/api/v1/process-call" \
|
| 79 |
-
-H "api-key: YOUR_API_KEY" \
|
| 80 |
-
-H "caller-number: ${CALLERID}" \
|
| 81 |
-
-H "called-number: ${CALLED}" \
|
| 82 |
-
-F "file=@/tmp/call-${UNIQUEID}.wav")
|
| 83 |
-
same => n,System(rm /tmp/call-${UNIQUEID}.wav)
|
| 84 |
-
same => n,Dial(SIP/${EXTEN})
|
| 85 |
-
same => n,Hangup()
|
| 86 |
```
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
-
|
| 100 |
-
1. Access the admin dashboard at `https://your-space-url/admin`
|
| 101 |
-
2. Log in with admin credentials
|
| 102 |
-
3. Manage customers and view call records
|
| 103 |
|
| 104 |
-
###
|
| 105 |
-
1. Provide customers with their API key
|
| 106 |
-
2. Share the Asterisk dialplan configuration
|
| 107 |
-
3. Guide them through Asterisk integration
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
3. Performs AI analysis
|
| 114 |
-
4. Stores results in the database
|
| 115 |
-
5. Cleans up temporary files
|
| 116 |
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
-
|
| 120 |
-
-
|
| 121 |
-
-
|
|
|
|
| 122 |
|
| 123 |
-
###
|
| 124 |
|
| 125 |
-
####
|
| 126 |
```
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
POST /api/v1/customers/
|
| 131 |
-
- Create new customer
|
| 132 |
-
- Requires admin token
|
| 133 |
-
|
| 134 |
-
GET /api/v1/customers/
|
| 135 |
-
- List all customers
|
| 136 |
-
- Requires admin token
|
| 137 |
-
|
| 138 |
-
GET /api/v1/customers/{customer_id}
|
| 139 |
-
- Get customer details
|
| 140 |
-
- Requires admin token
|
| 141 |
-
|
| 142 |
-
DELETE /api/v1/customers/{customer_id}
|
| 143 |
-
- Delete customer
|
| 144 |
-
- Requires admin token
|
| 145 |
```
|
| 146 |
|
| 147 |
-
####
|
| 148 |
```
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
- Headers:
|
| 153 |
-
- api-key: Customer's API key
|
| 154 |
-
- caller-number: Caller's phone number
|
| 155 |
-
- called-number: Called number
|
| 156 |
-
|
| 157 |
-
GET /api/v1/calls/{customer_id}
|
| 158 |
-
- List customer's calls
|
| 159 |
-
- Requires admin token
|
| 160 |
```
|
| 161 |
|
| 162 |
-
## Troubleshooting
|
| 163 |
-
|
| 164 |
-
### Common Issues
|
| 165 |
-
|
| 166 |
-
1. **API Key Invalid**
|
| 167 |
-
- Verify API key is correct
|
| 168 |
-
- Check if customer is active
|
| 169 |
-
- Ensure proper header format
|
| 170 |
-
|
| 171 |
-
2. **Call Processing Failed**
|
| 172 |
-
- Check audio file format (WAV)
|
| 173 |
-
- Verify file size limits
|
| 174 |
-
- Check server logs
|
| 175 |
-
|
| 176 |
-
3. **Database Connection Issues**
|
| 177 |
-
- Verify DATABASE_URL
|
| 178 |
-
- Check database credentials
|
| 179 |
-
- Ensure database is running
|
| 180 |
-
|
| 181 |
-
4. **Asterisk Integration Problems**
|
| 182 |
-
- Verify dialplan syntax
|
| 183 |
-
- Check file permissions
|
| 184 |
-
- Test curl command manually
|
| 185 |
-
|
| 186 |
### Support
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
For additional support:
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
## Security Considerations
|
| 193 |
-
|
| 194 |
-
1. **API Keys**
|
| 195 |
-
- Keep API keys secure
|
| 196 |
-
- Rotate keys periodically
|
| 197 |
-
- Use HTTPS only
|
| 198 |
-
|
| 199 |
-
2. **Admin Access**
|
| 200 |
-
- Use strong passwords
|
| 201 |
-
- Enable 2FA if available
|
| 202 |
-
- Monitor access logs
|
| 203 |
-
|
| 204 |
-
3. **Data Protection**
|
| 205 |
-
- Regular backups
|
| 206 |
-
- Encryption at rest
|
| 207 |
-
- Secure file handling
|
| 208 |
-
|
| 209 |
-
## Maintenance
|
| 210 |
-
|
| 211 |
-
1. **Regular Tasks**
|
| 212 |
-
- Monitor system resources
|
| 213 |
-
- Check error logs
|
| 214 |
-
- Update dependencies
|
| 215 |
-
|
| 216 |
-
2. **Backup Procedures**
|
| 217 |
-
- Database backups
|
| 218 |
-
- Configuration backups
|
| 219 |
-
- Recovery testing
|
| 220 |
-
|
| 221 |
-
3. **Updates**
|
| 222 |
-
- Monitor for security updates
|
| 223 |
-
- Test updates in staging
|
| 224 |
-
- Plan maintenance windows
|
|
|
|
| 1 |
# vBot User Manual
|
| 2 |
|
| 3 |
+
This manual provides comprehensive documentation for using the vBot system.
|
| 4 |
+
|
| 5 |
## Table of Contents
|
| 6 |
+
1. [Introduction](#introduction)
|
| 7 |
+
2. [Getting Started](#getting-started)
|
| 8 |
+
3. [Admin Interface](#admin-interface)
|
| 9 |
+
4. [Customer Management](#customer-management)
|
| 10 |
+
5. [API Usage](#api-usage)
|
| 11 |
+
6. [Troubleshooting](#troubleshooting)
|
| 12 |
+
|
| 13 |
+
## Introduction
|
| 14 |
|
| 15 |
+
vBot is an intelligent call analysis system that provides real-time transcription, sentiment analysis, and call summaries. The system is designed to be easy to use while providing powerful features for call center management and analysis.
|
|
|
|
| 16 |
|
| 17 |
### Key Features
|
| 18 |
+
- Real-time call transcription
|
|
|
|
|
|
|
|
|
|
| 19 |
- Sentiment analysis
|
| 20 |
+
- Call summaries
|
| 21 |
+
- Modern admin interface
|
| 22 |
+
- Secure API access
|
| 23 |
+
- Customer management
|
| 24 |
+
|
| 25 |
+
## Getting Started
|
| 26 |
+
|
| 27 |
+
### Prerequisites
|
| 28 |
+
- A Hugging Face account
|
| 29 |
+
- Access to the vBot system
|
| 30 |
+
- Admin credentials
|
| 31 |
+
|
| 32 |
+
### Initial Setup
|
| 33 |
+
1. Log in to the admin interface
|
| 34 |
+
2. Create your first customer
|
| 35 |
+
3. Configure your Asterisk system
|
| 36 |
+
4. Test the integration
|
| 37 |
+
|
| 38 |
+
## Admin Interface
|
| 39 |
+
|
| 40 |
+
### Login
|
| 41 |
+
1. Navigate to the admin interface
|
| 42 |
+
2. Enter your admin credentials
|
| 43 |
+
3. Click "Login"
|
| 44 |
+
|
| 45 |
+
### Dashboard
|
| 46 |
+
The dashboard provides an overview of:
|
| 47 |
+
- Total customers
|
| 48 |
+
- Active customers
|
| 49 |
+
- Recent activity
|
| 50 |
+
- System status
|
| 51 |
+
|
| 52 |
+
### Navigation
|
| 53 |
+
- **Customers**: Manage customer accounts
|
| 54 |
+
- **Settings**: Configure system settings
|
| 55 |
+
- **Logs**: View system logs
|
| 56 |
+
- **Help**: Access documentation
|
| 57 |
+
|
| 58 |
+
## Customer Management
|
| 59 |
+
|
| 60 |
+
### Adding Customers
|
| 61 |
+
1. Click "Add New Customer"
|
| 62 |
+
2. Fill in customer details:
|
| 63 |
+
- Name
|
| 64 |
+
- Company Name
|
| 65 |
+
- Email
|
| 66 |
+
3. Click "Save"
|
| 67 |
+
4. Copy the generated API key
|
| 68 |
+
|
| 69 |
+
### Managing Customers
|
| 70 |
+
- View customer list
|
| 71 |
+
- Edit customer details
|
| 72 |
+
- Enable/disable customers
|
| 73 |
+
- View customer usage
|
| 74 |
+
|
| 75 |
+
### Customer Settings
|
| 76 |
+
- API key management
|
| 77 |
+
- Usage limits
|
| 78 |
+
- Feature access
|
| 79 |
+
|
| 80 |
+
## API Usage
|
| 81 |
|
| 82 |
+
### Authentication
|
| 83 |
+
```bash
|
| 84 |
+
# Get JWT token
|
| 85 |
+
curl -X POST "https://your-space.huggingface.space/api/v1/token" \
|
| 86 |
+
-H "Content-Type: application/x-www-form-urlencoded" \
|
| 87 |
+
-d "username=admin&password=your-password"
|
| 88 |
+
```
|
| 89 |
|
| 90 |
+
### Customer API Endpoints
|
| 91 |
|
| 92 |
+
#### Process Call
|
| 93 |
+
```bash
|
| 94 |
+
curl -X POST "https://your-space.huggingface.space/api/v1/process-call" \
|
| 95 |
+
-H "api-key: YOUR_API_KEY" \
|
| 96 |
+
-H "caller-number: +1234567890" \
|
| 97 |
+
-H "called-number: +0987654321" \
|
| 98 |
+
-F "file=@call.wav"
|
| 99 |
+
```
|
| 100 |
|
| 101 |
+
#### Get Call Records
|
|
|
|
| 102 |
```bash
|
| 103 |
+
curl -X GET "https://your-space.huggingface.space/api/v1/calls" \
|
| 104 |
+
-H "api-key: YOUR_API_KEY"
|
|
|
|
|
|
|
| 105 |
```
|
| 106 |
|
| 107 |
+
#### Get Call Details
|
| 108 |
+
```bash
|
| 109 |
+
curl -X GET "https://your-space.huggingface.space/api/v1/calls/{call_id}" \
|
| 110 |
+
-H "api-key: YOUR_API_KEY"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
```
|
| 112 |
|
| 113 |
+
#### Search Calls
|
| 114 |
+
```bash
|
| 115 |
+
curl -X GET "https://your-space.huggingface.space/api/v1/calls/search" \
|
| 116 |
+
-H "api-key: YOUR_API_KEY" \
|
| 117 |
+
-H "Content-Type: application/json" \
|
| 118 |
+
-d '{
|
| 119 |
+
"start_date": "2024-01-01",
|
| 120 |
+
"end_date": "2024-01-31",
|
| 121 |
+
"caller_number": "+1234567890"
|
| 122 |
+
}'
|
| 123 |
+
```
|
| 124 |
|
| 125 |
+
### Response Formats
|
| 126 |
+
|
| 127 |
+
#### Call Processing Response
|
| 128 |
+
```json
|
| 129 |
+
{
|
| 130 |
+
"status": "success",
|
| 131 |
+
"call_id": "123",
|
| 132 |
+
"transcription": "Call transcript...",
|
| 133 |
+
"summary": "Call summary...",
|
| 134 |
+
"sentiment": "positive",
|
| 135 |
+
"timestamp": "2024-01-01T12:00:00Z"
|
| 136 |
+
}
|
| 137 |
+
```
|
| 138 |
|
| 139 |
+
#### Call Records Response
|
| 140 |
+
```json
|
| 141 |
+
{
|
| 142 |
+
"calls": [
|
| 143 |
+
{
|
| 144 |
+
"call_id": "123",
|
| 145 |
+
"caller_number": "+1234567890",
|
| 146 |
+
"called_number": "+0987654321",
|
| 147 |
+
"timestamp": "2024-01-01T12:00:00Z",
|
| 148 |
+
"duration": 300,
|
| 149 |
+
"status": "completed"
|
| 150 |
+
}
|
| 151 |
+
],
|
| 152 |
+
"total": 1,
|
| 153 |
+
"page": 1,
|
| 154 |
+
"per_page": 10
|
| 155 |
+
}
|
| 156 |
+
```
|
| 157 |
|
| 158 |
+
## Troubleshooting
|
|
|
|
|
|
|
|
|
|
| 159 |
|
| 160 |
+
### Common Issues
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
+
#### API Authentication
|
| 163 |
+
- Verify API key is correct
|
| 164 |
+
- Check API key permissions
|
| 165 |
+
- Ensure HTTPS is used
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
+
#### Call Processing
|
| 168 |
+
- Verify audio file format
|
| 169 |
+
- Check file size limits
|
| 170 |
+
- Monitor processing status
|
| 171 |
|
| 172 |
+
#### System Status
|
| 173 |
+
- Check system logs
|
| 174 |
+
- Monitor resource usage
|
| 175 |
+
- Verify database connection
|
| 176 |
|
| 177 |
+
### Error Messages
|
| 178 |
|
| 179 |
+
#### Authentication Errors
|
| 180 |
```
|
| 181 |
+
401 Unauthorized: Invalid API key
|
| 182 |
+
403 Forbidden: Insufficient permissions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
```
|
| 184 |
|
| 185 |
+
#### Processing Errors
|
| 186 |
```
|
| 187 |
+
400 Bad Request: Invalid file format
|
| 188 |
+
413 Payload Too Large: File size exceeds limit
|
| 189 |
+
500 Internal Server Error: Processing failed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
```
|
| 191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
### Support
|
| 193 |
+
- Check documentation
|
| 194 |
+
- Review error logs
|
| 195 |
+
- Contact system administrator
|
| 196 |
+
|
| 197 |
+
## Best Practices
|
| 198 |
+
|
| 199 |
+
### Security
|
| 200 |
+
- Keep API keys secure
|
| 201 |
+
- Use HTTPS for all requests
|
| 202 |
+
- Rotate API keys regularly
|
| 203 |
+
- Monitor access logs
|
| 204 |
+
|
| 205 |
+
### Performance
|
| 206 |
+
- Optimize audio file size
|
| 207 |
+
- Use appropriate sampling rates
|
| 208 |
+
- Monitor API usage limits
|
| 209 |
+
- Cache frequently accessed data
|
| 210 |
+
|
| 211 |
+
### Reliability
|
| 212 |
+
- Implement retry logic
|
| 213 |
+
- Handle API errors gracefully
|
| 214 |
+
- Monitor system health
|
| 215 |
+
- Regular backups
|
| 216 |
+
|
| 217 |
+
## Updates and Maintenance
|
| 218 |
+
|
| 219 |
+
### System Updates
|
| 220 |
+
- Monitor for new features
|
| 221 |
+
- Review changelog
|
| 222 |
+
- Test updates in staging
|
| 223 |
+
- Plan maintenance windows
|
| 224 |
+
|
| 225 |
+
### Backup and Recovery
|
| 226 |
+
- Regular data backups
|
| 227 |
+
- Document recovery procedures
|
| 228 |
+
- Test backup restoration
|
| 229 |
+
- Monitor backup status
|
| 230 |
+
|
| 231 |
+
## Contact Support
|
| 232 |
+
|
| 233 |
For additional support:
|
| 234 |
+
- Email: support@vbot.com
|
| 235 |
+
- Documentation: https://vbot.com/docs
|
| 236 |
+
- Community: https://vbot.com/community
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|