Fix mobile app: AccessToken for voice, Agent Manager for status, caller ID support
All checks were successful
Create Release / build (push) Successful in 3s
All checks were successful
Create Release / build (push) Successful in 3s
- Voice token: use AccessToken + VoiceGrant instead of browser-only ClientToken - Agent status: delegate to TWP_Agent_Manager matching browser phone behavior - Queue loading: add missing require_once for TWP_User_Queue_Manager - Add /phone-numbers endpoint for caller ID selection - Webhook: support CallerId param from mobile extraOptions - Flutter: caller ID dropdown in dialer, error logging in all catch blocks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:twilio_voice/twilio_voice.dart';
|
||||
import 'api_client.dart';
|
||||
|
||||
@@ -36,7 +37,7 @@ class VoiceService {
|
||||
_identity = data['identity'] as String;
|
||||
await TwilioVoice.instance.setTokens(accessToken: token);
|
||||
} catch (e) {
|
||||
// Token fetch failed - will retry on next interval
|
||||
debugPrint('VoiceService._fetchAndRegisterToken error: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +63,21 @@ class VoiceService {
|
||||
await TwilioVoice.instance.call.toggleSpeaker(speaker);
|
||||
}
|
||||
|
||||
Future<bool> makeCall(String to) async {
|
||||
return await TwilioVoice.instance.call.place(to: to, from: _identity ?? '') ?? false;
|
||||
Future<bool> makeCall(String to, {String? callerId}) async {
|
||||
try {
|
||||
final extraOptions = <String, dynamic>{};
|
||||
if (callerId != null && callerId.isNotEmpty) {
|
||||
extraOptions['CallerId'] = callerId;
|
||||
}
|
||||
return await TwilioVoice.instance.call.place(
|
||||
to: to,
|
||||
from: _identity ?? '',
|
||||
extraOptions: extraOptions,
|
||||
) ?? false;
|
||||
} catch (e) {
|
||||
debugPrint('VoiceService.makeCall error: $e');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> sendDigits(String digits) async {
|
||||
|
||||
Reference in New Issue
Block a user