Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.5.1
vBot Customer Webhook Handler
This package provides a simple webhook handler for vBot customers to receive and process call analysis results on their own servers.
Features
- Secure webhook endpoint with API key validation
- Automatic call record storage in MySQL database
- Configurable webhook secret for additional security
- Easy integration with LAMP stack
- Example implementation included
Requirements
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Apache/Nginx web server
- mod_rewrite enabled (for Apache)
Installation
Copy the contents of this package to your web server directory:
cp -r customer_webhook/* /var/www/html/vbot-webhook/Create the MySQL database and table:
CREATE DATABASE vbot_calls; USE vbot_calls; CREATE TABLE call_records ( id VARCHAR(36) PRIMARY KEY, customer_id INT NOT NULL, caller_number VARCHAR(20) NOT NULL, called_number VARCHAR(20) NOT NULL, transcription TEXT, summary TEXT, sentiment VARCHAR(50), keywords TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP );Configure the webhook handler:
- Copy
config/config.example.phptoconfig/config.php - Update the database credentials and webhook secret
- Copy
Set up Apache/Nginx:
- Ensure the webhook directory is accessible
- Configure URL rewriting (see examples)
Configuration
Edit config/config.php to set your:
- Database credentials
- Webhook secret (for additional security)
- API key (provided by vBot)
Usage
Your webhook URL will be:
https://your-domain.com/vbot-webhook/webhook.phpThe webhook will receive POST requests with call analysis data in JSON format:
{ "call_id": "uuid", "caller_number": "+1234567890", "called_number": "+0987654321", "transcription": "Call transcript...", "summary": "Call summary...", "sentiment": "positive", "keywords": "keyword1, keyword2", "timestamp": "2024-03-14T12:00:00Z", "customer_id": 123 }The handler will:
- Validate the API key
- Store the call record in your database
- Return a success response
Security
- All requests must include the API key in the
X-API-Keyheader - Optional webhook secret for additional security
- Input validation and sanitization
- SQL injection prevention
Examples
See the examples directory for:
- Apache configuration
- Nginx configuration
- Custom processing example
Support
For support, contact vBot support team or refer to the documentation.