Customer Codes Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Configuration Fields Reference
- Usage Flow
- Import/Export Feature
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Are Customer Codes?
Customer Codes are billing/tracking identifiers that can be associated with calls. When a user enters a customer code before making a call, the code is recorded in the CDR (Call Detail Record) for billing, reporting, and cost allocation purposes.
Architecture
Key Tables
| Table | Purpose | |
|---|---|---|
public.customer_codes | Code definitions | |
| CDR tables | Store code with call records |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/customerCodes/ | Frontend module | |
admin/apps/web/src/i18n/en/customerCodes.json | Translations |
2. Module Overview (Commercial/Business)
Business Value
Customer Codes enable cost allocation and billing tracking:
| Without Customer Codes | With Customer Codes | |
|---|---|---|
| All calls billed to department | Bill to specific clients/projects | |
| No project tracking | Track calls by matter/case | |
| Manual cost allocation | Automated reporting | |
| No accountability | Per-client billing |
Use Cases
- Law Firms / Professional Services
- Bill phone time to specific cases
- Agencies / Consultants
- Client-specific billing
- Cost Centers
- Project-based accounting
- Sales Teams
- Campaign attribution
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| CDR Integration | Codes appear in call records | |
| Import/Export | Bulk management via CSV | |
| Active Toggle | Enable/disable without deletion | |
| Multi-tenant | Separate codes per domain | |
| Description Field | Associate meaning with codes |
3. Module Overview (End User/Administrator)
What Can You Do?
- Create customer codes for billing purposes
- Add descriptions for code identification
- Import/export codes via CSV
- Enable/disable codes
Administrator Workflow
User Workflow (Using Customer Code)
Quick Tips
---
4. Configuration Fields Reference
Customer Code Fields
| Field | Description | Example | Required | |
|---|---|---|---|---|
| Customer Code | The code identifier | ACME-001 | Yes | |
| Description | Purpose notes | ACME Corp Account | No | |
| Active | Code enabled status | On/Off | Yes |
Code Format
Customer codes can include:
- Alphanumeric characters (A-Z, 0-9)
- Hyphens and underscores
- Typically 4-20 characters
---
5. Usage Flow
Customer Code Entry Flow
CDR Integration
When a call with a customer code is completed:
customer_codefield in CDR contains the entered code- Reports can filter/group by customer code
- Billing systems can use code for allocation
---
6. Import/Export Feature
CSV Export
Purpose: Backup codes or migrate to another system. Format:CSV Import
Import Modes:| Mode | Behavior | |
|---|---|---|
| Skip existing | Keep current codes, skip duplicates | |
| Update existing | Update description/active if code exists | |
| Replace all | Delete all and import fresh |
code- The customer codedescription- Optional notesactive- true/false
---
7. Common Scenarios & Examples
Scenario 1: Law Firm Client Matters
Codes:| Code | Description | |
|---|---|---|
| SMITH-2024-001 | Smith v. Jones Litigation | |
| ACME-CORP-GEN | ACME Corp General Counsel | |
| DOE-ESTATE-01 | Doe Estate Planning |
Scenario 2: Consulting Project Tracking
Codes:| Code | Description | |
|---|---|---|
| PROJ-ALPHA | Project Alpha - Deployment | |
| PROJ-BETA | Project Beta - Assessment | |
| INT-OVERHEAD | Internal / Non-billable |
Scenario 3: Sales Campaign Attribution
Codes:| Code | Description | |
|---|---|---|
| CAMP-Q1-WEB | Q1 Web Campaign Leads | |
| CAMP-Q1-EMAIL | Q1 Email Campaign Leads | |
| DIRECT-INBOUND | Direct Inbound Inquiries |
---
8. Limitations & Important Notes
Technical Limitations
Best Practices
- Consistent Format: Use standardized code formats
- Meaningful Codes: Map to billing/CRM systems
- Regular Audits: Archive unused codes
- User Training: Ensure users know when to enter codes
---
9. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| Code not in CDR | Code not entered/validated | Check call flow | |
| "Invalid code" | Code not found/disabled | Verify code exists and is active | |
| Users skip codes | Feature not enforced | Consider mandatory code policy |
Diagnostic SQL
List customer codes: Check code usage in CDR:---
10. Glossary
| Term | Definition | |
|---|---|---|
| Customer Code | Billing/tracking identifier for calls | |
| CDR | Call Detail Record—contains call metadata | |
| Matter Code | Legal industry term for client/case code | |
| Account Code | Alternate term for customer code | |
| Cost Center | Department/unit for expense allocation |
Lua Handler Status
⚡ No Dedicated Handler Required
Customer Codes is primarily a configuration module. The code entry and validation is handled by the dialplan/feature code system, and the code is stored in CDR during call processing. No dedicated Lua handler for customer codes exists.
---
Documentation last updated: January 2026