referCall method

Future<void> referCall({
  1. required String callId,
  2. required String targetUri,
})

Transfer an active SIP call to another destination (SIP REFER).

POST /v1/realtime/calls/{call_id}/refer

Implementation

Future<void> referCall({
  required String callId,
  required String targetUri, // e.g. "tel:+14155550123" or "sip:agent@example.com"
}) async {
  final res = await postJson('/realtime/calls/$callId/refer', {'target_uri': targetUri});
  if (res.statusCode != 200) {
    throw OpenAIRequestException.fromHttpResponse(res);
  }
}