Telecaller & Leads
Call Management
Call Log & Cross-Call Alerts

Call Log & Cross-Call Alerts

The Call Log system (CallLogBO.cs) is the foundational component that records all telecaller interactions. It provides critical functionality for tracking calls, normalizing contact information, and preventing duplicate efforts through intelligent cross-call alerts.

Call Logging Process

When a telecaller completes a call, the system records comprehensive details:

  • StaffId: The unique identifier of the telecaller who made the call
  • Mobile: The contact phone number (normalized to 10-digit format)
  • CallStatus: The outcome status of the call (see Lead Status Lifecycle)
  • Notes: Any relevant remarks or observations from the call
  • DateTime: Exact timestamp of when the call was logged
  • Duration: Length of the actual call in seconds

Call Logging Flow

Mobile Rectification

The system automatically normalizes mobile numbers to ensure consistency and prevent false negatives in the cross-call alert system.

Rectification Process:

  1. Strip leading zeros from the number
  2. Remove country code prefix (if present, typically +91 or 91)
  3. Validate resulting number is exactly 10 digits
  4. Reject invalid formats with user feedback

This ensures that the same contact (e.g., 9876543210, 09876543210, +919876543210) is treated as identical across all records.

Cross-Call Alert System

This is a critical feature that prevents duplicate calls to the same contact and provides visibility into previous interactions.

Alert Logic

When a call is logged, the system executes this query:

SELECT TOP 1
    sl.StaffId,
    s.StaffName,
    cl.CallDate,
    cl.CallStatus
FROM CallLog cl
INNER JOIN Staff s ON cl.StaffId = s.StaffId
WHERE cl.Mobile = @currentMobile
    AND cl.StaffId != @currentStaffId
    AND cl.CallDate >= DATEADD(DAY, -5, GETDATE())
ORDER BY cl.CallDate DESC

Alert Conditions:

  • Only shows when ANOTHER telecaller (different StaffId) handled the same number
  • Only considers calls from the past 5 days
  • Returns the most recent prior call if multiple matches exist
  • Does NOT alert for calls by the same telecaller (allows follow-ups)

Cross-Call Alert Sequence

Alert Display Format

When an alert is triggered, the telecaller sees:

⚠️  Alert: Previous Call Detected

This number was previously handled by Rajesh Kumar on 2026-03-18 with status "Call Back"

Status Details:
- Outcome: Call Back required
- Original Notes: Customer requested follow-up after project quotation

[Acknowledge] [Continue]

Data Model

The CallLog table structure:

ColumnTypeNotes
CallLogIdINT PKAuto-increment primary key
StaffIdINT FKReferences Staff.StaffId
MobileVARCHAR(10)Normalized 10-digit number
CallStatusVARCHAR(50)Status code (SV Fixed, CP, etc.)
NotesNVARCHAR(MAX)Call notes and observations
CallDateTimeDATETIMEWhen the call was logged
DurationINTCall duration in seconds
CreatedDateDATETIMERecord creation timestamp

Business Rules

  1. Mobile Normalization: All mobile numbers are automatically rectified before storage
  2. 5-Day Window: Cross-call alerts only check the past 5 calendar days
  3. Self-Exclusion: A telecaller's own previous calls do not trigger alerts
  4. Most Recent: If multiple prior calls exist, only the most recent is shown
  5. Alert is Informational: The alert does not block call logging; it's purely advisory
  6. No Cascade Blocks: A telecaller can still log a call to the same number regardless of alerts

Error Handling

ErrorHandling
Invalid mobile formatUser prompted to correct format
Duplicate call in same sessionSystem warns but allows (short delay)
Database unavailableGraceful fallback, alert skipped
Cross-call query timeoutTimeout after 5 seconds, alert skipped

Performance Considerations

  • The cross-call alert query has an index on (Mobile, StaffId, CallDate) for fast lookups
  • Result is cached for 30 seconds to prevent repeated queries for the same mobile
  • Alert popup is non-blocking; user can dismiss and continue