Ajit Panday commited on
Commit
685b2e5
·
1 Parent(s): c6d0d33

Add comprehensive user manual

Browse files
Files changed (1) hide show
  1. USER_MANUAL.md +224 -0
USER_MANUAL.md ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # vBot User Manual
2
+
3
+ ## Table of Contents
4
+ 1. [Overview](#overview)
5
+ 2. [System Requirements](#system-requirements)
6
+ 3. [Installation](#installation)
7
+ 4. [Configuration](#configuration)
8
+ 5. [Usage](#usage)
9
+ 6. [API Reference](#api-reference)
10
+ 7. [Troubleshooting](#troubleshooting)
11
+
12
+ ## Overview
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
+ - Multi-tenant support with secure API keys
17
+ - Real-time call processing
18
+ - Speech-to-text transcription
19
+ - Call summarization
20
+ - Sentiment analysis
21
+ - Secure admin dashboard
22
+ - RESTful API
23
+
24
+ ## System Requirements
25
+
26
+ ### Server Requirements
27
+ - Python 3.8 or higher
28
+ - MySQL 5.7 or higher
29
+ - 4GB RAM minimum
30
+ - 20GB storage minimum
31
+ - CUDA-capable GPU (recommended for faster processing)
32
+
33
+ ### Client Requirements
34
+ - Asterisk PBX system
35
+ - Internet connectivity
36
+ - curl command-line tool
37
+
38
+ ## Installation
39
+
40
+ ### 1. Deploy to Hugging Face Spaces
41
+ 1. Visit https://huggingface.co/spaces/iajitpanday/vBot
42
+ 2. Click "Use this Space"
43
+ 3. Choose your deployment settings
44
+ 4. Wait for the deployment to complete
45
+
46
+ ### 2. Configure Environment Variables
47
+ In your Hugging Face Space settings, add the following environment variables:
48
+ ```bash
49
+ JWT_SECRET=your-secure-secret-key
50
+ ADMIN_USERNAME=your-admin-username
51
+ ADMIN_PASSWORD=your-secure-password
52
+ DATABASE_URL=mysql+pymysql://username:password@host:port/database
53
+ ```
54
+
55
+ ### 3. Database Setup
56
+ 1. Create a MySQL database
57
+ 2. The application will automatically create required tables on first run
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
+ 2. Replace placeholders:
89
+ - `YOUR_API_KEY` with the customer's API key
90
+ - `your-huggingface-space-url` with your actual Space URL
91
+
92
+ 3. Add the dialplan to your Asterisk configuration:
93
+ - Copy to `/etc/asterisk/dialplan/`
94
+ - Include in `extensions.conf`
95
+ - Reload Asterisk dialplan
96
+
97
+ ## Usage
98
+
99
+ ### 1. Admin Dashboard
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
+ ### 2. Customer Integration
105
+ 1. Provide customers with their API key
106
+ 2. Share the Asterisk dialplan configuration
107
+ 3. Guide them through Asterisk integration
108
+
109
+ ### 3. Call Processing
110
+ The system automatically:
111
+ 1. Records incoming calls
112
+ 2. Sends audio to the processing server
113
+ 3. Performs AI analysis
114
+ 4. Stores results in the database
115
+ 5. Cleans up temporary files
116
+
117
+ ## API Reference
118
+
119
+ ### Authentication
120
+ - Admin: JWT token authentication
121
+ - Customers: API key in header
122
+
123
+ ### Endpoints
124
+
125
+ #### Admin Endpoints
126
+ ```
127
+ POST /api/v1/token
128
+ - Login to get admin token
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
+ #### Customer Endpoints
148
+ ```
149
+ POST /api/v1/process-call
150
+ - Process call recording
151
+ - Requires customer API key
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
+ 1. Check the logs in your Hugging Face Space
189
+ 2. Contact system administrator
190
+ 3. Review error messages in Asterisk logs
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