pressIvrKey method

Future<void> pressIvrKey(
  1. String digit
)

Press a key in the current IVR menu.

Implementation

Future<void> pressIvrKey(String digit) async {
  final s = ivr.value;
  if (s == null || s.status != NexusIvrStatus.active) return;
  try {
    final res = await _post('/partner/voice/ivr/input', {'sessionId': s.sessionId, 'digit': digit});
    final inst = res?['instruction'];
    if (inst is Map) await _handleIvr(s.sessionId, Map<String, dynamic>.from(inst));
  } catch (e) {
    NexusLog.warn('voice.pressIvrKey failed: $e');
  }
}