PHPackages                             taknone/phptgcalls - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. taknone/phptgcalls

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

taknone/phptgcalls
==================

A high-performance, non-blocking PHP library for Telegram Group Calls and WebRTC streaming via Rust

v0.0.1(yesterday)30MITRustPHP &gt;=8.4

Since Jun 18Pushed yesterdayCompare

[ Source](https://github.com/TakNone/phptgcalls)[ Packagist](https://packagist.org/packages/taknone/phptgcalls)[ RSS](/packages/taknone-phptgcalls/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

 [![PHP Extension](https://camo.githubusercontent.com/4586f8b86d282f07073b3e4a91d74153adbb2ee50d622d2b052d7670e3f355ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505f457874656e73696f6e2d3738374342353f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d666666666666)](https://camo.githubusercontent.com/4586f8b86d282f07073b3e4a91d74153adbb2ee50d622d2b052d7670e3f355ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505f457874656e73696f6e2d3738374342353f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d666666666666) [![Powered By Rust](https://camo.githubusercontent.com/922f5c3b72fcbe0dfb9e0039c9f188a1780b968072d13f93b52af8c6fe59d572/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f42795f527573742d4646324332433f7374796c653d666f722d7468652d6261646765266c6f676f3d72757374266c6f676f436f6c6f723d666666666666)](https://camo.githubusercontent.com/922f5c3b72fcbe0dfb9e0039c9f188a1780b968072d13f93b52af8c6fe59d572/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f42795f527573742d4646324332433f7374796c653d666f722d7468652d6261646765266c6f676f3d72757374266c6f676f436f6c6f723d666666666666) [![Telegram Calls](https://camo.githubusercontent.com/9c6d0be9b1ab99deb71a9311818c34658fc727173db5264b03d04996a3302b54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54656c656772616d5f43616c6c732d3236413545343f7374796c653d666f722d7468652d6261646765266c6f676f3d74656c656772616d266c6f676f436f6c6f723d666666666666)](https://camo.githubusercontent.com/9c6d0be9b1ab99deb71a9311818c34658fc727173db5264b03d04996a3302b54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54656c656772616d5f43616c6c732d3236413545343f7374796c653d666f722d7468652d6261646765266c6f676f3d74656c656772616d266c6f676f436f6c6f723d666666666666)

 [![TgCalls PHP Extension](https://camo.githubusercontent.com/e0f3d99fde4752362f8830cfc74a0acae00c2eecb7e309f45a2607c8b0f747cd/68747470733a2f2f726561646d652d747970696e672d7376672e64656d6f6c61622e636f6d3f666f6e743d4a6574427261696e732b4d6f6e6f267765696768743d3730302673697a653d3430266475726174696f6e3d333030302670617573653d3130303026636f6c6f723d4646324332432663656e7465723d74727565267643656e7465723d74727565266d756c74696c696e653d74727565267265706561743d747275652677696474683d383030266865696768743d313030266c696e65733d546743616c6c732b5048502b457874656e73696f6e)](https://camo.githubusercontent.com/e0f3d99fde4752362f8830cfc74a0acae00c2eecb7e309f45a2607c8b0f747cd/68747470733a2f2f726561646d652d747970696e672d7376672e64656d6f6c61622e636f6d3f666f6e743d4a6574427261696e732b4d6f6e6f267765696768743d3730302673697a653d3430266475726174696f6e3d333030302670617573653d3130303026636f6c6f723d4646324332432663656e7465723d74727565267643656e7465723d74727565266d756c74696c696e653d74727565267265706561743d747275652677696474683d383030266865696768743d313030266c696e65733d546743616c6c732b5048502b457874656e73696f6e)

 **⚡ A blazing-fast PHP extension powered by Rust for Telegram voice/video calls ⚡**

 [![Stars](https://camo.githubusercontent.com/bf1f60677a669771ff2a905fd12c14fda3a6f97fdb4b42ad223c5da0635f2ea3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d464644373030266c6f676f3d676974687562)](https://camo.githubusercontent.com/bf1f60677a669771ff2a905fd12c14fda3a6f97fdb4b42ad223c5da0635f2ea3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d464644373030266c6f676f3d676974687562) [![Forks](https://camo.githubusercontent.com/c194ff822a2ff41d1b5314fe154dd66d2cd3ac13cc0f1397cbd5fd2a7b975eed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d366534306339266c6f676f3d676974687562)](https://camo.githubusercontent.com/c194ff822a2ff41d1b5314fe154dd66d2cd3ac13cc0f1397cbd5fd2a7b975eed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d366534306339266c6f676f3d676974687562) [![License](https://camo.githubusercontent.com/4a1f03b1061565bec8e7cd3c47c8970f59c40278e8a7fe4196e7b7f4c2d91ea6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d303039363838)](https://camo.githubusercontent.com/4a1f03b1061565bec8e7cd3c47c8970f59c40278e8a7fe4196e7b7f4c2d91ea6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d303039363838) [![Last Commit](https://camo.githubusercontent.com/18dc8de468236d0eace6a0b0faa29650e34631ead12ef0aa092c591483d4fd93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d666636396234)](https://camo.githubusercontent.com/18dc8de468236d0eace6a0b0faa29650e34631ead12ef0aa092c591483d4fd93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f54616b4e6f6e652f706870746763616c6c733f7374796c653d666c61742d73717561726526636f6c6f723d666636396234) [![PHP 8.4+](https://camo.githubusercontent.com/5a277ab200bcc737f0bc91fb4a2960c5d0bea41f02f378942dc2eef9f423cbbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342b2d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/5a277ab200bcc737f0bc91fb4a2960c5d0bea41f02f378942dc2eef9f423cbbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342b2d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465) [![Rust 1.96.0+](https://camo.githubusercontent.com/f6dcdd72cf7814d9ee8d93916d8d9c93e6ad21d8af720c1e72ea91ea2ce02c9c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f527573742d312e39362e302b2d4646324332433f7374796c653d666c61742d737175617265266c6f676f3d72757374266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/f6dcdd72cf7814d9ee8d93916d8d9c93e6ad21d8af720c1e72ea91ea2ce02c9c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f527573742d312e39362e302b2d4646324332433f7374796c653d666c61742d737175617265266c6f676f3d72757374266c6f676f436f6c6f723d7768697465)

---

🎯 What is PhpTgCalls ?
----------------------

[](#-what-is-phptgcalls-)

> **PhpTgCalls** is a native PHP extension built with **Rust** that brings **Telegram voice &amp; video calling** capabilities directly into PHP. It wraps the powerful [NTgCalls](https://github.com/pytgcalls/ntgcalls) C++ library, providing a clean, object-oriented PHP API

It integrates seamlessly with **[LiveProto](https://github.com/TakNone/LiveProto)** — the async, pure-PHP MTProto Telegram client — enabling you to **join group calls, stream audio/video, and handle Telegram VoIP** entirely from PHP

---

✨ Features
----------

[](#-features)

CategoryFeature🎙️ **Core**Join group calls ( voice &amp; video )🎥 **Media**Stream audio/video with H.264, VP8, VP9, AV1, Opus, AAC, MP3📺 **Screen**Screen sharing &amp; presentation mode🔄 **Async**Fully asynchronous — built for **Fibers** &amp; **Swoole**🔐 **Crypto**DH key exchange, encryption params, signaling📡 **Events**Stream, connection, upgrade, frame, and signaling event streams⚡ **Performance**Rust-powered native code, minimal overhead🧩 **Ecosystem**First-class [LiveProto](https://github.com/TakNone/LiveProto) integration---

🏗️ Architecture
---------------

[](#️-architecture)

 ```
sequenceDiagram
    autonumber
    participant P as PHP (Application Layer)
    participant R as Rust Extension (Bridge)
    participant C as NTgCalls (C++ Core)

    Note over P, C: Initialization Phase
    P->>R: Instantiate TgcallsClient
    R-->>P: Return Native Instance Pointer
    P->>R: Enable Events (Initialize Buffer/FD)

    rect rgb(240, 248, 255)
        Note right of P: Request/Response Flow
        P->>R: Call Method (Payload)
        R->>C: FFI Bridge (WebRTC/Boost)
        C-->>R: Return Result
        R-->>P: Return Data to PHP
    end

    rect rgb(245, 245, 245)
        Note right of P: Async Event Handling (FD Mechanism)
        C->>R: Event Callback (Direct)
        R->>R: Write to File Descriptor (FD)
        loop Async Consumption
            P->>R: Read from FD Buffer
            R-->>P: Dispatch Event Object
        end
    end
```

      Loading ---

📦 Installation
--------------

[](#-installation)

### Prerequisites

[](#prerequisites)

- **PHP 8.4+**
- **Rust 1.96.0+**

### From Source

[](#from-source)

```
git clone https://github.com/TakNone/phptgcalls.git
cd phptgcalls
cd ext

sudo bash install.sh
```

### Verify Installation

[](#verify-installation)

```
php --ri phptgcalls
```

### Composer

[](#composer)

Note

Automated Rust extension installation and php.ini configuration :

```
composer require taknone/phptgcalls
```

Note

To install the framework package without triggering the automatic extension installation script, use :

```
composer require taknone/phptgcalls --no-scripts
```

---

🚀 Quick Start
-------------

[](#-quick-start)

```
