hangupCall method

Future<void> hangupCall({
  1. required String callId,
})

Hang up an active realtime call (SIP or WebRTC).

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

Implementation

Future<void> hangupCall({required String callId}) async {
  final res = await postJson('/realtime/calls/$callId/hangup', const {});
  if (res.statusCode != 200) {
    throw OpenAIRequestException.fromHttpResponse(res);
  }
}