Files
boc/landvex/node_modules/openai/resources/realtime/calls.mjs
T
Bernt 6989a98d75 feat: Passwordless cross-device authentication
- Arkitektur: docs/auth/passwordless-architecture.md
- Backend: iom/quixzoom-auth-service/ (FastAPI + Redis)
- Webb: quixzoom-market-pages/se/login/ (QR-kod + polling)
- App: iom/quixzoom-app/src/features/auth/ (push + deep links)

Flöde: QR-kod → app-godkännande → webb-inloggad
2026-07-07 07:11:50 +00:00

75 lines
2.3 KiB
JavaScript

// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { buildHeaders } from "../../internal/headers.mjs";
import { path } from "../../internal/utils/path.mjs";
export class Calls extends APIResource {
/**
* Accept an incoming SIP call and configure the realtime session that will handle
* it.
*
* @example
* ```ts
* await client.realtime.calls.accept('call_id', {
* type: 'realtime',
* });
* ```
*/
accept(callID, body, options) {
return this._client.post(path `/realtime/calls/${callID}/accept`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
__security: { bearerAuth: true },
});
}
/**
* End an active Realtime API call, whether it was initiated over SIP or WebRTC.
*
* @example
* ```ts
* await client.realtime.calls.hangup('call_id');
* ```
*/
hangup(callID, options) {
return this._client.post(path `/realtime/calls/${callID}/hangup`, {
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
__security: { bearerAuth: true },
});
}
/**
* Transfer an active SIP call to a new destination using the SIP REFER verb.
*
* @example
* ```ts
* await client.realtime.calls.refer('call_id', {
* target_uri: 'tel:+14155550123',
* });
* ```
*/
refer(callID, body, options) {
return this._client.post(path `/realtime/calls/${callID}/refer`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
__security: { bearerAuth: true },
});
}
/**
* Decline an incoming SIP call by returning a SIP status code to the caller.
*
* @example
* ```ts
* await client.realtime.calls.reject('call_id');
* ```
*/
reject(callID, body = {}, options) {
return this._client.post(path `/realtime/calls/${callID}/reject`, {
body,
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
__security: { bearerAuth: true },
});
}
}
//# sourceMappingURL=calls.mjs.map