2026-07-07 11:07:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
use Blax\WebRtc\Media\NullMediaEngine;
|
2026-07-07 11:07:59 +00:00
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Signaling bind
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Where the signaling server (on the shared ReactPHP kernel) listens. For
|
|
|
|
|
| browser clients you will typically front this with the laravel-websockets
|
|
|
|
|
| WS transport instead; this raw endpoint drives + tests the media engine.
|
|
|
|
|
*/
|
|
|
|
|
'host' => env('WEBRTC_HOST', '127.0.0.1'),
|
|
|
|
|
'port' => (int) env('WEBRTC_PORT', 8090),
|
|
|
|
|
|
|
|
|
|
// ReactPHP TLS context; leave both unset for plain TCP.
|
|
|
|
|
'tls' => array_filter([
|
|
|
|
|
'local_cert' => env('WEBRTC_TLS_CERT'),
|
|
|
|
|
'local_pk' => env('WEBRTC_TLS_KEY'),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Media engine
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| The backend that terminates media (ICE/DTLS/SRTP/RTP/Opus), records, and
|
|
|
|
|
| bridges to external realtime providers. NullMediaEngine = signaling only;
|
|
|
|
|
| Str0mMediaEngine requires the blax_webrtc Rust extension (see rust/).
|
|
|
|
|
*/
|
|
|
|
|
'media_engine' => env('WEBRTC_MEDIA_ENGINE', NullMediaEngine::class),
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Recording
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Where server-side call recordings are written (attach them to your own
|
|
|
|
|
| transmission rows afterwards).
|
|
|
|
|
*/
|
|
|
|
|
'recording' => [
|
|
|
|
|
'disk' => env('WEBRTC_RECORDING_DISK', 'local'),
|
|
|
|
|
'path' => env('WEBRTC_RECORDING_PATH', 'webrtc/recordings'),
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| ICE servers (STUN/TURN) advertised to browsers
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
'ice_servers' => [
|
|
|
|
|
// ['urls' => 'stun:stun.l.google.com:19302'],
|
|
|
|
|
// ['urls' => 'turn:turn.example.com:3478', 'username' => '...', 'credential' => '...'],
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| External realtime bridge (provider hidden from the browser)
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| The media engine dials these; the browser only ever talks to us, so the AI
|
|
|
|
|
| provider is invisible and the model is swappable server-side.
|
|
|
|
|
*/
|
|
|
|
|
'bridge' => [
|
|
|
|
|
'openai' => [
|
|
|
|
|
'model' => env('WEBRTC_OPENAI_MODEL', 'gpt-realtime'),
|
|
|
|
|
'api_key' => env('OPENAI_API_KEY'),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
];
|