# ashiqualii/vonage_voice architecture

> Architecture diagram of the GitHub repository ashiqualii/vonage_voice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashiqualii/vonage_voice
- Repository: https://github.com/ashiqualii/vonage_voice

## Overview

Vonage Voice is a Flutter plugin for integrating Vonage voice calls with native Android Telecom and iOS CallKit behavior. The principal workflow is: the host app authenticates with a backend-issued JWT, the plugin establishes a Vonage session, and incoming pushes or Flutter-initiated outgoing calls enter the native call stack; call state and controls are then exposed to Flutter. The README documents platform flows and capabilities; source excerpts are partial, so some cross-platform links reflect documented behavior rather than inspected implementation details.

Main entry points: [`lib/vonage_voice.dart`](https://github.com/ashiqualii/vonage_voice/blob/main/lib/vonage_voice.dart) (Flutter call API), [`ios/Classes/VonageVoicePlugin.swift`](https://github.com/ashiqualii/vonage_voice/blob/main/ios/Classes/VonageVoicePlugin.swift) (iOS call plugin), [`android/src/main/kotlin/com/iocod/vonage/vonage_voice/VonageVoicePlugin.kt`](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/VonageVoicePlugin.kt) (Android plugin bridge), [`android/src/main/kotlin/com/iocod/vonage/vonage_voice/service/TVConnectionService.kt`](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/service/TVConnectionService.kt) (Telecom service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter API and state"]
  node_flutter_api["Flutter call API<br/>[vonage_voice.dart]"]
  node_dart_channels["Platform channels"]
  node_call_models["Call models<br/>[call_session.dart]"]
  node_call_state["Call state manager"]
end

subgraph group_android_incoming["Android incoming calls"]
  node_android_push["FCM push handler"]
  node_telecom_service["Telecom service"]
  node_call_connections["Call connections"]
  node_incoming_ui["Incoming call UI"]
  node_answer_trampoline["Answer trampoline"]
end

subgraph group_android_runtime["Android call runtime"]
  node_android_plugin["Android plugin bridge"]
  node_android_storage[("Call preferences<br/>[StorageImpl.kt]")]
end

subgraph group_ios["iOS call runtime"]
  node_ios_plugin["iOS call plugin"]
end

subgraph group_external["External systems"]
  node_backend["JWT backend"]
  node_vonage["Vonage Voice"]
  node_fcm["Firebase FCM"]
  node_apns["APNs VoIP"]
  node_mobile_os["Mobile call OS"]
end

node_host_user(("Host app user"))

node_host_user -->|"initiates calls"| node_flutter_api
node_backend -->|"issues JWT"| node_flutter_api
node_flutter_api -->|"invokes native calls"| node_dart_channels
node_dart_channels -.->|"dispatches methods"| node_android_plugin
node_dart_channels -.->|"dispatches methods"| node_ios_plugin
node_flutter_api -.->|"exposes call state"| node_call_models
node_call_models -.->|"tracks sessions"| node_call_state
node_android_plugin -->|"creates sessions and calls"| node_vonage
node_fcm -->|"delivers incoming push"| node_android_push
node_android_push -->|"starts call service"| node_telecom_service
node_telecom_service -->|"manages connections"| node_call_connections
node_call_connections -->|"launches call UI"| node_incoming_ui
node_incoming_ui -.->|"answers from notification"| node_answer_trampoline
node_telecom_service -->|"broadcasts call events"| node_android_plugin
node_android_plugin -->|"persists caller settings"| node_android_storage
node_telecom_service -->|"integrates Telecom"| node_mobile_os
node_ios_plugin -->|"receives VoIP pushes"| node_apns
node_ios_plugin -->|"reports calls to CallKit"| node_mobile_os
node_ios_plugin -->|"restores sessions and resolves invites"| node_vonage
node_ios_plugin -->|"emits call state"| node_flutter_api
node_android_plugin -->|"emits call events"| node_flutter_api

click node_flutter_api "https://github.com/ashiqualii/vonage_voice/blob/main/lib/vonage_voice.dart"
click node_dart_channels "https://github.com/ashiqualii/vonage_voice/blob/main/lib/_internal/method_channel/vonage_call_method_channel.dart"
click node_call_models "https://github.com/ashiqualii/vonage_voice/blob/main/lib/models/call_session.dart"
click node_call_state "https://github.com/ashiqualii/vonage_voice/blob/main/lib/models/call_session_manager.dart"
click node_android_plugin "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/VonageVoicePlugin.kt"
click node_android_push "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/fcm/VonageFirebaseMessagingService.kt"
click node_telecom_service "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/service/TVConnectionService.kt"
click node_call_connections "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/call/TVCallInviteConnection.kt"
click node_incoming_ui "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/IncomingCallActivity.kt"
click node_answer_trampoline "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/AnswerCallTrampolineActivity.kt"
click node_android_storage "https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/storage/StorageImpl.kt"
click node_ios_plugin "https://github.com/ashiqualii/vonage_voice/blob/main/ios/Classes/VonageVoicePlugin.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flutter_api,node_dart_channels,node_call_models,node_call_state,node_host_user toneBlue
class node_android_push,node_telecom_service,node_call_connections,node_incoming_ui,node_answer_trampoline toneAmber
class node_android_plugin,node_android_storage toneMint
class node_ios_plugin toneRose
class node_backend,node_vonage,node_fcm,node_apns,node_mobile_os toneIndigo
```

## Components

### Flutter API and state

- [Flutter call API](https://github.com/ashiqualii/vonage_voice/blob/main/lib/vonage_voice.dart): `lib/vonage_voice.dart`
- [Platform channels](https://github.com/ashiqualii/vonage_voice/blob/main/lib/_internal/method_channel/vonage_call_method_channel.dart): `lib/_internal/method_channel/vonage_call_method_channel.dart`
- [Call models](https://github.com/ashiqualii/vonage_voice/blob/main/lib/models/call_session.dart): `lib/models/call_session.dart`
- [Call state manager](https://github.com/ashiqualii/vonage_voice/blob/main/lib/models/call_session_manager.dart): `lib/models/call_session_manager.dart`

### Android incoming calls

- [FCM push handler](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/fcm/VonageFirebaseMessagingService.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/fcm/VonageFirebaseMessagingService.kt`
- [Telecom service](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/service/TVConnectionService.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/service/TVConnectionService.kt`
- [Call connections](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/call/TVCallInviteConnection.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/call/TVCallInviteConnection.kt`
- [Incoming call UI](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/IncomingCallActivity.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/IncomingCallActivity.kt`
- [Answer trampoline](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/AnswerCallTrampolineActivity.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/AnswerCallTrampolineActivity.kt`

### Android call runtime

- [Android plugin bridge](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/VonageVoicePlugin.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/VonageVoicePlugin.kt`
- [Call preferences](https://github.com/ashiqualii/vonage_voice/blob/main/android/src/main/kotlin/com/iocod/vonage/vonage_voice/storage/StorageImpl.kt): `android/src/main/kotlin/com/iocod/vonage/vonage_voice/storage/StorageImpl.kt`

### iOS call runtime

- [iOS call plugin](https://github.com/ashiqualii/vonage_voice/blob/main/ios/Classes/VonageVoicePlugin.swift): `ios/Classes/VonageVoicePlugin.swift`

### External systems

- **JWT backend**
- **Vonage Voice**
- **Firebase FCM**
- **APNs VoIP**
- **Mobile call OS**

### Other components

- **Host app user**

## Connections

- Host app user → Flutter call API: initiates calls (evidence: `README.md`)
- JWT backend → Flutter call API: issues JWT (evidence: `README.md`)
- Flutter call API → Platform channels: invokes native calls (evidence: `README.md`)
- Platform channels → Android plugin bridge: dispatches methods
- Platform channels → iOS call plugin: dispatches methods
- Flutter call API → Call models: exposes call state
- Call models → Call state manager: tracks sessions
- Android plugin bridge → Vonage Voice: creates sessions and calls (evidence: `README.md`)
- Firebase FCM → FCM push handler: delivers incoming push (evidence: `README.md`)
- FCM push handler → Telecom service: starts call service (evidence: `android/src/main/kotlin/com/iocod/vonage/vonage_voice/fcm/VonageFirebaseMessagingService.kt`)
- Telecom service → Call connections: manages connections (evidence: `android/src/main/kotlin/com/iocod/vonage/vonage_voice/service/TVConnectionService.kt`)
- Call connections → Incoming call UI: launches call UI (evidence: `android/src/main/kotlin/com/iocod/vonage/vonage_voice/call/TVCallInviteConnection.kt`)
- Incoming call UI → Answer trampoline: answers from notification (evidence: `android/src/main/kotlin/com/iocod/vonage/vonage_voice/AnswerCallTrampolineActivity.kt`)
- Telecom service → Android plugin bridge: broadcasts call events (evidence: `README.md`)
- Android plugin bridge → Call preferences: persists caller settings (evidence: `android/src/main/kotlin/com/iocod/vonage/vonage_voice/VonageVoicePlugin.kt`)
- Telecom service → Mobile call OS: integrates Telecom (evidence: `README.md`)
- iOS call plugin → APNs VoIP: receives VoIP pushes (evidence: `README.md`)
- iOS call plugin → Mobile call OS: reports calls to CallKit (evidence: `README.md`)
- iOS call plugin → Vonage Voice: restores sessions and resolves invites (evidence: `README.md`)
- iOS call plugin → Flutter call API: emits call state (evidence: `README.md`)
- Android plugin bridge → Flutter call API: emits call events (evidence: `README.md`)
