Add ring broadcast, ring timeout watchdog, CMTI dedup, and hangup fix#1
Conversation
KerseyFabrications
commented
Apr 17, 2026
- Broadcast ring event on each subsequent RING URC (enables DAWN ringtone + MIRAGE notification TTL reset)
- Ring timeout watchdog: polls AT+CLCC after 10s of no RING to detect voicemail forwarding without termination URC
- CMTI dedup: suppress duplicate +CMTI for same index within 3s
- Hangup now publishes call_ended directly with reason "local_hangup" instead of relying on URC (fixes stuck MIRAGE notification)
Review Summary by QodoAdd ring broadcast, timeout watchdog, CMTI dedup, and hangup fix
WalkthroughsDescription• Broadcast ring event on each subsequent RING URC for MIRAGE/DAWN • Ring timeout watchdog polls AT+CLCC after 10s to detect voicemail forwarding • CMTI deduplication suppresses duplicate SMS notifications within 3s window • Hangup publishes call_ended directly instead of relying on URC Diagramflowchart LR
RING["RING URC received"]
RING -- "update g_last_ring_time" --> STATE{Call state?}
STATE -- "RINGING_IN" --> BROADCAST["Broadcast ring event"]
STATE -- "IDLE" --> NEWCALL["Set RINGING_IN state"]
BROADCAST --> MQTT1["Publish to MQTT"]
NEWCALL --> MQTT1
HANGUP["Hangup command"]
HANGUP -- "AT+CHUP" --> IDLE["Set IDLE state"]
IDLE -- "publish call_ended" --> MQTT2["Publish to MQTT"]
WATCHDOG["Ring timeout watchdog"]
WATCHDOG -- "10s elapsed" --> CLCC["Poll AT+CLCC"]
CLCC -- "no calls" --> TIMEOUT["Publish ring_timeout"]
TIMEOUT --> MQTT3["Publish to MQTT"]
CMTI["CMTI URC received"]
CMTI -- "check dedup" --> DEDUP{Duplicate<br/>within 3s?}
DEDUP -- "yes" --> SUPPRESS["Suppress"]
DEDUP -- "no" --> PROCESS["Process SMS"]
File Changes1. src/oasis-echo.c
|
Code Review by Qodo
1. mqtt_publish_event() return ignored
|
- Broadcast ring event on each subsequent RING URC (enables DAWN ringtone + MIRAGE notification TTL reset) - Ring timeout watchdog: polls AT+CLCC after 10s of no RING to detect voicemail forwarding without termination URC - CMTI dedup: suppress duplicate +CMTI for same index within 3s - Hangup now publishes call_ended directly with reason "local_hangup" instead of relying on URC (fixes stuck MIRAGE notification)
a4e80d1 to
5f3ecce
Compare
- Atomic helpers for g_last_ring_time (get/set with acquire/release) to prevent torn reads between URC reader and main thread - Hangup treats AT_NO_CARRIER as success (same as AT_OK) to ensure call_ended is always published regardless of modem response variant Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Match DAWN's log format: [LEVEL] HH:MM:SS.mmm file:line: Uses gettimeofday + localtime_r for thread-safe timestamps. Widen preamble from 35 to 45 chars to accommodate timestamp.