PBX CLI Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Terminal Commands Reference
- Button Configuration
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Is PBX CLI?
PBX CLI is a web-based terminal interface that provides remote access to the FreeSWITCH CLI (fs_cli) and system commands directly from the admin panel. It includes customizable quick-access buttons for common commands.
Architecture
Key Features
| Feature | Description | |
|---|---|---|
| Web Terminal | Browser-based CLI access | |
| WebSocket | Real-time command/response | |
| Quick Buttons | Customizable command shortcuts | |
| Command History | Navigate with up/down arrows | |
| Tab Completion | Auto-complete commands |
Key Tables
| Table | Purpose |
|---|---|
public.pbx_cli_button_configs | Custom button configurations |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/pbxCli/ | Frontend module | |
admin/apps/web/src/i18n/en/pbxCli.json | Translations |
2. Module Overview (Commercial/Business)
Business Value
PBX CLI provides remote system administration:
| Without PBX CLI | With PBX CLI | |
|---|---|---|
| SSH required | Browser access | |
| Command-line only | Visual terminal | |
| Manual commands | Quick buttons | |
| No shortcuts | Customizable buttons |
Use Cases
- System Monitoring
- View active calls and channels
- Configuration Management
- List loaded modules
- Troubleshooting
- Enable SIP tracing
- Quick Diagnostics
- Active media bugs
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| Browser-Based | No SSH client needed | |
| Quick Buttons | One-click commands | |
| Custom Buttons | Tenant-specific shortcuts | |
| Live Output | Real-time command results | |
| Log Tailing | Follow logs in browser |
3. Module Overview (End User/Administrator)
What Can You Do?
- Execute FreeSWITCH CLI commands
- Run system commands
- Use quick-access buttons
- Configure custom buttons
- Navigate command history
- View real-time logs
Administrator Interface
Quick Tips
TIP
Arrow Keys: Use Up/Down to navigate command history.TIP
Tab Completion: Press Tab for command autocomplete.CAUTION
Sensitive Commands: Be careful with commands that modify system state.---
4. Terminal Commands Reference
System & Core Commands
| Command | Description | |
|---|---|---|
fs_cli -x "status" | FreeSWITCH system status | |
fs_cli -x "version" | Build version and libraries | |
fs_cli -x "uptime" | How long FreeSWITCH running | |
fs_cli -x "modules list" | List loaded modules | |
fs_cli -x "reloadxml" | Reload dialplan/XML config |
SIP & Sofia Commands
| Command | Description | |
|---|---|---|
fs_cli -x "sofia status" | All SIP profiles status | |
fs_cli -x "sofia status profile internal" | Internal profile status | |
fs_cli -x "sofia status profile external" | External profile status | |
fs_cli -x "sofia global siptrace on" | Enable SIP tracing | |
fs_cli -x "sofia global siptrace off" | Disable SIP tracing |
Calls & Channels Commands
| Command | Description | |
|---|---|---|
fs_cli -x "show calls" | List active calls | |
fs_cli -x "show channels" | Show active channels | |
fs_cli -x "show media_bugs" | Active recordings/taps | |
fs_cli -x "show calls count" | Call statistics |
Log Commands
| Command | Description | |
|---|---|---|
tail -n 50 /var/log/freeswitch/freeswitch.log | Last 50 log lines | |
tail -f /var/log/freeswitch/freeswitch.log | Follow log file |
5. Button Configuration
Default Buttons
| Button | Command | Description | |
|---|---|---|---|
| Status | fs_cli -x "status" | System status | |
| Sofia Status | fs_cli -x "sofia status" | SIP profiles | |
| Show Channels | fs_cli -x "show channels" | Active channels | |
| Show Calls | fs_cli -x "show calls" | Active calls | |
| Reload XML | fs_cli -x "reloadxml" | Reload config | |
| Modules List | fs_cli -x "modules list" | Loaded modules | |
| Tail Log | tail -n 50 ... | Recent logs | |
| Tail Follow | tail -f ... | Follow logs |
Custom Button Configuration
Button Fields
| Field | Description | Example | |
|---|---|---|---|
| Label | Button text | Gateway Status | |
| Tooltip | Hover description | Show gateway registrations | |
| Command | Command to execute | fs_cli -x "sofia status gateway" | |
| Order Index | Button position | 10 (lower = first) | |
| Enabled | Button active | On/Off |
6. Common Scenarios & Examples
Scenario 1: Check Active Calls
Command:fs_cli -x "show calls"
Output:
Scenario 2: Reload Dialplan After Changes
Command:fs_cli -x "reloadxml"
Output:
Scenario 3: Troubleshoot SIP Registration
Commands:fs_cli -x "sofia status profile internal"- Check profilefs_cli -x "sofia global siptrace on"- Enable tracing- (reproduce issue)
fs_cli -x "sofia global siptrace off"- Disable tracing
Scenario 4: Monitor Call Volume
Button: "Call Stats"| Setting | Value | |
|---|---|---|
| Label | Call Stats | |
| Command | fs_cli -x "show calls count" | |
| Order | 5 |
7. Limitations & Important Notes
Technical Notes
NOTE
WebSocket Required: Terminal requires active WebSocket connection.WARNING
System Access: Commands execute with backend permissions. Be careful with destructive commands.WARNING
Log Following: tail -f runs until manually stopped.Security Considerations
- Access Control: Only admin users should access PBX CLI
- Audit Logging: Commands may be logged for audit
- Read-Only vs Write: Be careful with state-changing commands
- Production Safety: Test commands in non-production first
Best Practices
- Use Quick Buttons: For common tasks
- Avoid Long Commands: Terminal may timeout
- Stop Follow Commands: Use Ctrl+C or close terminal
- Document Custom Buttons: Keep track of custom configurations
- Test Before Production: Verify commands work as expected
---
8. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| Disconnected | WebSocket error | Refresh page | |
| No output | Command timeout | Try simpler command | |
| Auth error | Token expired | Re-login | |
| Command fails | Invalid syntax | Check fs_cli format | |
| Buttons missing | Config issue | Check button configs |
Connection Messages
| Message | Meaning | |
|---|---|---|
| Connected | WebSocket active | |
| Disconnected | Connection lost | |
| Connection error | WebSocket failed | |
| Auth missing | Token not found |
WebSocket Debugging
---
9. Glossary
| Term | Definition | |
|---|---|---|
| fs_cli | FreeSWITCH CLI tool | |
| Sofia | SIP module in FreeSWITCH | |
| Channel | Media connection instance | |
| Profile | SIP endpoint configuration | |
| WebSocket | Real-time browser connection | |
| Terminal | Command-line interface |
Lua Script Status ℹ️
No Lua Handler Required
| Component | Status |
|---|---|
| PBX CLI | ℹ️ Frontend terminal module - commands executed by backend via fs_cli |
fs_cli or system shell, not through Lua handlers.
---
Documentation last updated: January 2026