vodia-cli
v1.0.5
Published
Vodia PBX CLI tool with web browser support
Maintainers
Readme
Vodia PBX CLI
A powerful command-line tool for analyzing and migrating 3CX PBX system data to Vodia PBX format. This CLI helps you extract extension information from 3CX database backups and export them in various formats for easy migration.
🚀 Features
- 3CX Database Analysis: Parse and analyze 3CX database XML files
- Extension Extraction: Extract user extensions with detailed information
- Multiple Export Formats: Export data as CSV or TAR files
- Batch Processing: Process multiple database files at once
- Data Validation: Verify file format before processing
- Interactive CLI: User-friendly command-line interface with colored output
📦 Installation
Global Installation (Recommended)
npm install -g vodia-pbx-cliLocal Installation
npm install vodia-pbx-cli🛠️ Usage
Display Help
vodia-pbx-cli help
# or
vodia-pbx-cli -hAnalyze 3CX Database
vodia-pbx-cli 3cx --path /path/to/3cx/backup/folder
# or
vodia-pbx-cli 3cx -p /path/to/3cx/backup/folder📋 Commands
help
Display available commands and options.
Usage:
vodia-pbx-cli help
vodia-pbx-cli -h
vodia-pbx-cli --help3cx
Analyze 3CX database files and extract extension information.
Usage:
vodia-pbx-cli 3cx --path <folderPath>Options:
-p, --path <folderPath>: Path to the folder containing 3CX backup files (required)
What it does:
- Scans the specified folder for 3CX database files (
*Db.xml) - Validates file format to ensure it's a valid 3CX database
- Extracts extension information including:
- Extension Number
- First Name
- Last Name
- Email Address
- Authentication Password
- Displays results in a formatted table
- Offers export options (CSV or TAR format)
📁 File Structure Requirements
The tool looks for XML files ending with Db.xml in the specified folder. These files should contain valid 3CX database structure with the following elements:
<?xml version="1.0" encoding="utf-8"?>
<PhoneSystem>
<header>
<version>...</version>
<Date>...</Date>
<TenantName>...</TenantName>
</header>
<Parameters>
<Extension>
<Number>100</Number>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<EmailAddress>[email protected]</EmailAddress>
<AuthPassword>password123</AuthPassword>
</Extension>
<!-- More extensions... -->
</Parameters>
</PhoneSystem>📤 Export Formats
CSV Export
Exports extension data to a CSV file with the following columns:
- Number
- First Name
- Last Name
- Email Address
- Auth Password
Output file: 3cx-extensions.csv (in current directory)
TAR Export
Creates a TAR archive containing a domain.xml file formatted for Vodia PBX:
<?xml version="1.0" encoding="utf-8"?>
<domain>
<users>
<type>extensions</type>
<primary-name>
<display>100</display>
<name>100</name>
<type>acc</type>
</primary-name>
<body>
<display_name>Doe</display_name>
<first_name>John</first_name>
<password>password123</password>
<email_address>[email protected]</email_address>
</body>
</users>
</domain>Output file: 3cx-extensions-[timestamp].tar (in current directory)
🎯 Example Usage
# Navigate to your 3CX backup folder
cd /home/user/3cx-backups
# Run the analysis
vodia-pbx-cli 3cx --path ./database-backup
# Follow the interactive prompts to export dataExample Output:
🔍 Analyzing 3CX database in: ./database-backup
Found 1 3CX database file(s):
Processing: SystemDb.xml
✅ Valid 3CX database format
Found 25 extensions
┌────────┬────────────┬───────────┬─────────────────────────┬───────────────┐
│ Number │ First Name │ Last Name │ Email Address │ Auth Password │
├────────┼────────────┼───────────┼─────────────────────────┼───────────────┤
│ 100 │ John │ Doe │ [email protected] │ abc123 │
│ 101 │ Jane │ Smith │ [email protected] │ xyz789 │
└────────┴────────────┴───────────┴─────────────────────────┴───────────────┘
╔═════════════════════════════════════╗
║ EXPORT OPTIONS ║
╠═════════════════════════════════════╣
║ 1. Export as CSV ║
║ 2. Export as TAR ║
║ 3. Skip export ║
╚═════════════════════════════════════╝
Enter your choice (1-3): 1
✅ CSV file exported to: /current/directory/3cx-extensions.csv🔧 Requirements
- Node.js 12 or higher
- Read access to 3CX backup files
📚 Dependencies
This package uses the following key dependencies:
chalk- Terminal stylingfiglet- ASCII art texttable- Table formattingglob- File pattern matchingcsv-writer- CSV file generationtar- TAR archive creationfs-extra- Enhanced file system operations
🐛 Error Handling
The tool includes comprehensive error handling for:
- Missing or invalid folder paths
- Invalid file formats
- Corrupted XML data
- File system permissions
- Export failures
📖 Support
For more information about Vodia PBX, visit: https://doc.vodia.com/
🤝 Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
📄 License
[Add your license information here]
🏷️ Version History
- 1.0.0 - Initial release with 3CX database analysis and export functionality
