Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/jiff-chat/node_modules/openai/resources/realtime/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Calls = void 0;
const resource_1 = require("../../core/resource.js");
const headers_1 = require("../../internal/headers.js");
const path_1 = require("../../internal/utils/path.js");
class Calls extends resource_1.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((0, path_1.path) `/realtime/calls/${callID}/accept`, {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* 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((0, path_1.path) `/realtime/calls/${callID}/hangup`, {
...options,
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* 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((0, path_1.path) `/realtime/calls/${callID}/refer`, {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* 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((0, path_1.path) `/realtime/calls/${callID}/reject`, {
body,
...options,
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
}
exports.Calls = Calls;
//# sourceMappingURL=calls.js.map |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0067 ]-- |