All checks were successful
Create Release / build (push) Successful in 4s
Backend: Add /voice/token endpoint with AccessToken + VoiceGrant for mobile VoIP, implement unhold_call() with call leg detection, wire FCM push notifications into call queue and webhook missed call handlers, add data-only FCM message support for Android background wake, and add Twilio API Key / Push Credential settings fields. Flutter app: Full softphone with Twilio Voice SDK integration, JWT auth with auto-refresh, SSE real-time queue updates, FCM push notifications, Material 3 UI with dashboard, active call screen, dialpad, and call controls (mute/speaker/hold/transfer). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.0 KiB
Dart
39 lines
1.0 KiB
Dart
enum AgentStatusValue { available, busy, offline }
|
|
|
|
class AgentStatus {
|
|
final AgentStatusValue status;
|
|
final bool isLoggedIn;
|
|
final String? currentCallSid;
|
|
final String? lastActivity;
|
|
final bool availableForQueues;
|
|
|
|
AgentStatus({
|
|
required this.status,
|
|
required this.isLoggedIn,
|
|
this.currentCallSid,
|
|
this.lastActivity,
|
|
this.availableForQueues = true,
|
|
});
|
|
|
|
factory AgentStatus.fromJson(Map<String, dynamic> json) {
|
|
return AgentStatus(
|
|
status: _parseStatus(json['status'] as String),
|
|
isLoggedIn: json['is_logged_in'] as bool,
|
|
currentCallSid: json['current_call_sid'] as String?,
|
|
lastActivity: json['last_activity'] as String?,
|
|
availableForQueues: json['available_for_queues'] as bool? ?? true,
|
|
);
|
|
}
|
|
|
|
static AgentStatusValue _parseStatus(String s) {
|
|
switch (s) {
|
|
case 'available':
|
|
return AgentStatusValue.available;
|
|
case 'busy':
|
|
return AgentStatusValue.busy;
|
|
default:
|
|
return AgentStatusValue.offline;
|
|
}
|
|
}
|
|
}
|