Skip to main content

normalize_phone

Function normalize_phone 

Source
pub(crate) fn normalize_phone(raw: &str) -> String
Expand description

Strips everything but ASCII digits, so the same phone number in different formats — Meta’s inbound from (no +) vs. a caller-supplied to in E.164 (+-prefixed) or with spaces/dashes — normalizes to one 24h-window state key. WhatsAppBridge::record_inbound (mod.rs) applies this same normalization when storing, so the two call sites always agree.