π‘ Inspiration
In fast-growing and high-density urban markets, last-mile logistics companies face delivery failure rates as high as 30% to 35%. The root causes are almost always communication breakdowns:
- Estate Gate Restrictions: Gated residential estates require visitor gate pass codes before security lets riders in.
- Absent Recipients: Recipients are away from home when the rider arrives at their doorstep.
- Ignored SMS Notifications: Text messages are frequently delayed, overlooked, or filtered out as spam.
- Dispatcher Bottlenecks: Manual phone calls by human dispatch staff do not scale and are expensive.
We realized that traditional text notifications stop at generating words, but real-world logistics requires taking action. We were inspired to build DispatchPulse β an automated, 2-stage AI voice verification and rider dispatch engine powered by CALL-E. Instead of sending an SMS, DispatchPulse picks up the phone, calls the customer to confirm delivery details, and immediately calls the dispatch rider to deliver those instructions over the phone line.
π How We Built It
DispatchPulse is built as a full-stack, real-time logistics command center using TypeScript, Node.js, Express, Server-Sent Events (SSE), and the CALL-E Voice AI Platform (@call-e/calle).
graph TD
A[Dispatch Command Center<br>HTML5 / CSS3 / JavaScript] -->|POST /api/dispatch| B[DispatchPulse Backend<br>Express / TypeScript]
B -->|Stage 1: real CALL-E call| C((Customer Phone))
C -->|Voice turns & gate code| B
B -->|Stage 2: real CALL-E call| D((Rider Phone))
D -->|Verbal acknowledgement| B
B -->|Real-Time SSE Stream| A
π The 2-Stage Automated Voice Pipeline
Stage 1 β Customer Verification Call:
- The system places an outbound voice call to the customer (
customerPhone). - Using a clear, polite Nigerian persona, the AI agent confirms the address, checks recipient availability, and extracts gate pass codes (
gate_pass_code), security drop-off notes, or reschedule requests.
- The system places an outbound voice call to the customer (
Stage 2 β Automated Rider Briefing Call:
- As soon as Stage 1 finishes, the backend analyzes the structured outcome and constructs a personalized briefing task.
- It places a second real outbound CALL-E call to the assigned fleet rider (
assignedRider.phone). - The AI agent briefs the rider verbally (e.g., "Customer confirmed. Gate pass code is GATE-4921. Enter code at security post." or "Customer requested to reschedule. Hold delivery and return package to hub.") and captures the rider's verbal acknowledgment.
Real-Time Dashboard Streaming:
- Live status badges, turn-by-turn voice dialogue bubbles, and extracted JSON intelligence are streamed to the dispatcher's dashboard via Server-Sent Events (SSE).
β οΈ Challenges We Faced
1. Multi-Stage Call Orchestration & State Synchronization
Coordinating two sequential real phone calls asynchronously required careful state management. We had to ensure that Stage 2 only launched once Stage 1 completed and its structured JSON payload was fully validated.
We modeled the total workflow latency $T_{\text{workflow}}$ mathematically as:
$$T_{\text{workflow}} = T_{\text{customer_call}} + \delta_{\text{extraction}} + T_{\text{rider_call}}$$
where $\delta_{\text{extraction}}$ represents the structured JSON extraction and briefing prompt generation delay ($\delta_{\text{extraction}} < 500\text{ ms}$).
2. Telephony Routing & DNS Stability
We encountered Node.js v20+ IPv4/IPv6 dual-stack DNS resolution quirks during outbound HTTP fetch requests to global telephony endpoints. We solved this by engineering an inline --import ./src/dns-fix.js bootstrap patch that forces IPv4-first resolution for Undici/Fetch network calls.
3. Voice Turn Parsing & Speaker Disambiguation
Raw telemetry events from SIP trunks arrive with varying message formats (Callee said: ..., Bot is speaking: ..., etc.). We built a unified parser parseActivityToTranscript(activity, calleeLabel) to filter out system logs and cleanly isolate dialogue turns for both Customer and Rider call stages.
π What We Learned
- Voice AI Gets Real-World Tasks Done: SMS messages are passive, but phone calls demand immediate attention. Automated voice agents dramatically improve pre-delivery confirmation rates.
- Closed-Loop Communication Increases Delivery Success: By connecting both ends of the delivery chain (Customer $\rightarrow$ AI $\rightarrow$ Rider), the delivery confirmation probability $P(\text{Success})$ increases significantly:
$$P(\text{Success}) = P(\text{Verified} \mid \text{Customer Call}) \times P(\text{Briefed} \mid \text{Rider Call})$$
- Localized Persona Persona Matters: Speaking in a polite, localized tone (e.g. Nigerian accent and phrasing) increases recipient trust, reduces hang-ups, and yields clear, accurate gate codes.
π What's Next for DispatchPulse
- π± Multi-Language Support: Expanding voice persona capabilities to Yoruba, Hausa, Igbo, and Nigerian Pidgin.
- π¬ Omnichannel Fallback: Adding automated WhatsApp / SMS fallback links if a recipient's phone line is busy or unreachable.
- πΊοΈ Live GPS Telemetry: Integrating live rider GPS mapping and automated route re-calculation based on reschedule call outcomes.
Built With
- call-e/calle
- express.js
- node.js
- typescript
Log in or sign up for Devpost to join the conversation.