Vishal Tyagi
← Projects
Communication Workflows·production

Hybrid Telephony Workflows

Built a unified multi-channel communication state machine so operators can move between cloud virtual numbers and cellular calling inside one session — without tearing down auth, caches, or sync queues.

Date2026-04
Reading TimeN/A
Statusproduction
StackFlutter, Dart, State Machines+1

In-session (no forced re-login)

Mode switch

[High Confidence]

callMedium threaded through activity and reports

Attribution

[High Confidence]

Timeline

  • Session fragmentation audit

    Confirmed mode switches forced logout and full session re-init.

  • Unified state model

    Replaced parallel boolean flags with a single SIM / Cloud / Hybrid enum.

  • In-app selector and attribution

    Shipped CallMediumSelector and threaded callMedium through logs and analytics.

What it does

Sales and ops teams use more than one calling path — cloud virtual numbers and native cellular. Channel mode used to be bound at session start. Switching modes meant logout, re-select profile, re-auth, and rebuild local storage and sync queues.

The replacement is a session-preserving orchestrator: mode is an enum the active session can change; auth tokens, Hive caches, and background sync stay intact.

Constraints

  • Mode changes must not destroy cached state or auth
  • Same behavior on Android, iOS, and admin web
  • Availability gated by role permissions and virtual-number allocations
  • Workflow layer must not assume low-level transport details of each driver

Decisions & tradeoffs

  1. Single enum (SIM / Cloud / Hybrid) instead of scattered booleans
  2. Session-preserving orchestrator that swaps channel drivers without resetting the user session
  3. CallMediumSelector for persistent defaults or per-call overrides
  4. callMedium metadata on outbound events, activity logs, exports, and dashboards
flowchart TD
  ActiveSession[Active User Session] --> Orchestrator[Unified State Orchestrator]
  Orchestrator --> Enum{Calling Mode}
  Enum -->|Cellular| Native[Native Cellular Driver]
  Enum -->|Cloud| Cloud[Cloud Virtual Driver]
  Enum -->|Hybrid| Dynamic[Per-Interaction Selector]
  Native --> Retained[Session and Caches Retained]
  Cloud --> Retained
  Dynamic --> Retained

Tradeoffs: in-session switching needs careful concurrent-state handling. Strict enums required a one-time cleanup of legacy invalid mode values.

What it demonstrates

  • Product workflow design under real operational constraints
  • State-machine modeling for multi-channel UX
  • End-to-end attribution so reporting matches how calls actually happened

See also the architecture case study.