External Lead Assignment
The ExternalLeadBO.cs module handles assignment of leads from external sources (non-Facebook, non-call) to available telecallers. The system prioritizes reusing telecallers who have recently handled the same prospect to maintain relationship continuity.
Core Business Logic
4-Day Mobile Deduplication
Before assigning any new external lead, the system performs a critical deduplication check:
- Dedup Query: A stored procedure (
sp_CheckMobileDuplicateInPast4Daysor equivalent) is called with the incoming mobile number - Window: Checks the past 4 calendar days of lead assignments
- Staff Reuse: If a duplicate is found, the lead is automatically assigned back to the same telecaller who handled it previously
- New Lead Flow: If no duplicate is found, the lead enters normal assignment routing (round-robin or manager assignment)
Assignment Pipeline
The complete external lead assignment flow follows this sequence:
- Lead Reception: New lead arrives with mobile number, name, email, source info
- Mobile Dedup Check: Query previous 4 days of assignments
- Routing Decision:
- Duplicate found → Assign to previous staff
- No duplicate → Continue to staff selection
- Available Staff Selection: Get list of available telecallers, check TeleLeader mapping
- Database Insert: Record in
ExternalLeadstable with StaffId, Mobile, CallSourceId, CreatedDate
Database Schema
| Field | Type | Purpose |
|---|---|---|
| ExternalLeadId | PK | Unique identifier |
| StaffId | FK | Assigned telecaller |
| Mobile | String | Primary lead identifier |
| String | Contact email | |
| Name | String | Lead name |
| CallSourceId | FK | Campaign/source reference |
| CreatedDate | DateTime | Assignment timestamp |
| Status | String | Lead processing status |
Assignment Flow Diagram
Deduplication Check Sequence Diagram
Implementation Considerations
Performance Optimization
- Dedup Check: Indexed query on
(Mobile, CreatedDate)for fast lookups - Staff Availability: Cached in-memory to avoid repeated database hits
- TeleLeader Mapping: Configuration-driven, cached on application startup
Error Handling
- No Available Staff: Assign to queue or manager escalation
- Mobile Number Validation: Sanitize and normalize before dedup check
- Duplicate Insert Prevention: Use unique constraint or transactional lock
Staff Reuse Benefits
- Continuity: Customer hears from same person, improves conversion
- Context Retention: Staff remembers previous interaction
- Reduced Ramp-up: No need to brief staff on repeat prospects
Related Components
- ExternalLeads Table: Stores all external lead assignments
- Staff Service: Manages staff availability and allocation
- TeleLeader Mapping: Configuration for staff-to-leader relationships
- CallSource: Links leads to source campaigns for analytics