Telecaller & Leads
Lead Ingestion
External Lead Assignment

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:

  1. Dedup Query: A stored procedure (sp_CheckMobileDuplicateInPast4Days or equivalent) is called with the incoming mobile number
  2. Window: Checks the past 4 calendar days of lead assignments
  3. Staff Reuse: If a duplicate is found, the lead is automatically assigned back to the same telecaller who handled it previously
  4. 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:

  1. Lead Reception: New lead arrives with mobile number, name, email, source info
  2. Mobile Dedup Check: Query previous 4 days of assignments
  3. Routing Decision:
    • Duplicate found → Assign to previous staff
    • No duplicate → Continue to staff selection
  4. Available Staff Selection: Get list of available telecallers, check TeleLeader mapping
  5. Database Insert: Record in ExternalLeads table with StaffId, Mobile, CallSourceId, CreatedDate

Database Schema

FieldTypePurpose
ExternalLeadIdPKUnique identifier
StaffIdFKAssigned telecaller
MobileStringPrimary lead identifier
EmailStringContact email
NameStringLead name
CallSourceIdFKCampaign/source reference
CreatedDateDateTimeAssignment timestamp
StatusStringLead 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