PHPackages                             apntalk/esl-react - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. apntalk/esl-react

ActiveLibrary[Queues &amp; Workers](/categories/queues)

apntalk/esl-react
=================

ReactPHP-native inbound FreeSWITCH ESL runtime for PHP — async connection management, command dispatch, event streaming, health, and reconnect supervision

v0.2.14(2mo ago)054MITPHPPHP ^8.3CI failing

Since Apr 15Pushed 2mo agoCompare

[ Source](https://github.com/apn-ra/esl-react)[ Packagist](https://packagist.org/packages/apntalk/esl-react)[ Docs](https://github.com/apn-ra/esl-react)[ RSS](/packages/apntalk-esl-react/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (18)Used By (0)

apntalk/esl-react
=================

[](#apntalkesl-react)

ReactPHP-native inbound FreeSWITCH ESL runtime for PHP.

This package turns `apntalk/esl-core` into a usable long-lived async runtime: it manages socket connections, authenticates ESL sessions, dispatches async commands, streams typed events, supervises reconnection, monitors liveness, and exposes operational health — all within the ReactPHP event loop.

Current implementation status:

- Implemented and test-covered: runtime construction, connect/auth lifecycle, inbound frame pump, serial `api()` dispatch, live typed event streaming, raw event-envelope delivery, unknown-event handling, live-session subscription/filter control, reconnect supervision after unexpected disconnect, desired-state restore after re-authentication, tracked `bgapi()`, explicit backpressure rejection, bounded drain shutdown, health snapshots, and deterministic fake-server integration tests.
- Implemented and contract-stabilized: replay-safe runtime hook emission for supported runtime paths.
- Implemented and test-covered in the current runner milestones: a narrow prepared-input runner seam plus a richer prepared-bootstrap input path that can carry prepared ReactPHP transport access, prepared ingress pipeline access, and runtime-local session context.
- Implemented and test-covered for truthful runtime substrate export: runner feedback/status now also surface queue posture, accepted-work identity, recovery generation identity, reconstruction posture, replay continuity posture, recent terminal-publication facts, and recent lifecycle-semantic observations using `apntalk/esl-core` vocabulary.
- Implemented and test-covered for higher-layer observation: runner lifecycle snapshots, exportable runner status snapshots, and push-based lifecycle callbacks that expose startup state, connection/session health, liveness, reconnecting, drain, and failure truth without giving downstream packages runtime ownership. Recent runtime-owned connect/disconnect/failure timestamps and bounded cause summaries live on the status snapshot surface, not on the coarse lifecycle callback.
- The runner observation contract is intentionally split: `lifecycleSnapshot()` / `onLifecycleChange()` stay coarse and stable for lifecycle observation, while `feedbackSnapshot()` and `statusSnapshot()` carry the richer reconnect/backoff timing, terminal-stop, and disconnect/failure-cause detail.
- Present but still minimal relative to the plan: heartbeat orchestration beyond the current liveness probe and recover-on-silence behavior.
- `connect()` is idempotent while a connection attempt is already in progress and resolves immediately when already authenticated.
- `api()` is rejected before successful authentication.
- The current connect/auth handshake timeout reuses `CommandTimeoutConfig::$apiTimeoutSeconds`, fails closed, stops autonomous reconnect for that startup attempt, and surfaces `handshake_timeout` on the runner reconnect/status snapshots.
- `disconnect()` now enters bounded drain mode: new work is rejected immediately, already-accepted work may settle until the configured drain timeout, remaining inflight work is then terminated deterministically, and the runtime closes terminally without reconnecting.

Release note and tag-prep summary for the next patch release: [docs/release-prep-v0.2.13.md](docs/release-prep-v0.2.13.md)

---

Package relationships
---------------------

[](#package-relationships)

PackageRole`apntalk/esl-core`Protocol substrate: parsing, serialization, typed command/reply/event models, replay envelope primitives`apntalk/esl-react`Async runtime: connection lifecycle, command dispatch, event streaming, reconnect supervision, health`apntalk/laravel-freeswitch-esl`Laravel integration: service provider, container wiring, database-backed PBX registry, control plane`esl-react` depends on `esl-core` and is a required dependency of `laravel-freeswitch-esl`. It has no knowledge of Laravel or any application framework.

---

Scope — v1.x
------------

[](#scope--v1x)

This package implements an **inbound ESL client runtime only**.

It connects to a running FreeSWITCH instance using the inbound Event Socket Library connection model, where the PHP process initiates the TCP connection to FreeSWITCH.

### What this package does NOT include

[](#what-this-package-does-not-include)

- Laravel service provider or framework integration
- Database-backed PBX connection registry
- Multi-PBX orchestration policy or connection routing
- Application-specific telephony normalization rules
- Durable replay persistence or replay playback engine
- Cluster leadership or cross-node ownership policy
- Outbound ESL server support (FreeSWITCH initiates the connection)

These concerns belong to `apntalk/laravel-freeswitch-esl` or application code.

---

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- `react/event-loop` ^1.5
- `react/promise` ^3.2
- `react/socket` ^1.16
- `apntalk/esl-core` ^0.2.13
- `ext-dom` is required transitively by `apntalk/esl-core` ^0.2.10+

---

Installation
------------

[](#installation)

```
composer require apntalk/esl-react
```

---

Quick start
-----------

[](#quick-start)

```
