PHPackages                             akramghaleb/laravel-grandstream - 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. akramghaleb/laravel-grandstream

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

akramghaleb/laravel-grandstream
===============================

Laravel SDK for Grandstream Devices

v1.0.2(6mo ago)142MITPHPPHP ^8.3CI passing

Since Oct 18Pushed 6mo agoCompare

[ Source](https://github.com/akramghaleb/laravel-grandstream)[ Packagist](https://packagist.org/packages/akramghaleb/laravel-grandstream)[ Docs](https://github.com/akramghaleb/laravel-grandstream)[ GitHub Sponsors]()[ RSS](/packages/akramghaleb-laravel-grandstream/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (4)Used By (0)

Laravel SDK for Grandstream Devices
===================================

[](#laravel-sdk-for-grandstream-devices)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9376381e2a817d2d224c0cb2c7232cd05fbc672b0fd139eb78d8c6aaf88e2d36/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616b72616d6768616c65622f6c61726176656c2d6772616e6473747265616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akramghaleb/laravel-grandstream)[![Total Downloads](https://camo.githubusercontent.com/d7cf54c11139bdddb1f42c7a690f8129fb04bc7b3ae9e62a596ea49bc7daba13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b72616d6768616c65622f6c61726176656c2d6772616e6473747265616d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akramghaleb/laravel-grandstream)

---

📦 Overview
----------

[](#-overview)

**Laravel Grandstream** is a clean SDK for integrating Laravel apps with **Grandstream UCM** PBX devices.
It simplifies REST API communication, including:

- Challenge → Token → Cookie authentication flow
- Cached login cookies per user/session
- Unified API request handling with auto-retry on cookie expiration
- Easy integration into Filament dashboards or CRM systems

Ideal for **real-time call monitoring**, **extension management**, or **PBX-based CRM dashboards**.

---

📖 Official API Reference
------------------------

[](#-official-api-reference)

The complete Grandstream HTTPS API documentation is available here:
👉 [**Grandstream UCM6xxx HTTPS API Guide (PDF)**](https://www.grandstream.com/hubfs/Product_Documentation/UCM_API_Guide.pdf)

It includes:

- Authentication flow (**`challenge`** → **`login`**)
- Voice &amp; call control endpoints (**listBridgedChannels**, **Hangup**, **CallTransfer**, etc.)
- CDR &amp; Recording APIs (**cdrapi**, **recapi**)
- Error codes and result structures

> This Laravel package aligns with the same API structure and request schema described in that official document.

---

⚙️ Installation
---------------

[](#️-installation)

Install the package via Composer:

```
composer require akramghaleb/laravel-grandstream

```

Then publish the configuration file:

```
php artisan vendor:publish --tag="laravel-grandstream-config"

```

---

🔧 Configuration
---------------

[](#-configuration)

A `config/grandstream.php` file will be created.
Add your device credentials to `.env`:

```
UCM_BASE=https://your-ucm-ip
UCM_API_USER=apiuser
UCM_API_PASS=apipassword
UCM_API_VER=1.2
UCM_COOKIE_TTL=9
GRANDSTREAM_WEBHOOK_USER=admin
GRANDSTREAM_WEBHOOK_PASS=password

```

---

🚀 Usage
-------

[](#-usage)

Use the **Facade** for simple calls:

```
use AkramGhaleb\LaravelGrandstream\Facades\Grandstream;

// Example: List extensions
$response = Grandstream::listAccount();

// Example: Fetch call records (CDR)
$cdr = Grandstream::getData('cdrapi', ["format":"json"]);
```

The package automatically retries failed requests when cookies expire (`-6`, `-8`, `-37`).

---

🧩 Example Response
------------------

[](#-example-response)

```
{
    "status": 0,
    "response": {
        "total": 125,
        "cdr": [
            {
            "call_time": "2025-10-18 09:14:23",
            "src": "1001",
            "dst": "1002",
            "duration": "00:00:12",
            "disposition": "ANSWERED"
            }
        ]
    }
}
```

---

🧱 Advanced Usage
----------------

[](#-advanced-usage)

Inject it directly instead of using the Facade:

```
use AkramGhaleb\LaravelGrandstream\Grandstream;

class CallController
{
    public function index()
    {
        $calls = Grandstream::listUnBridgedChannels();
        return $calls;
    }
}
```

---

🧪 Testing
---------

[](#-testing)

```
composer test

```

---

📝 Changelog
-----------

[](#-changelog)

See [CHANGELOG](CHANGELOG.md) for details.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome!
Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting a PR.

---

🛡️ Security
-----------

[](#️-security)

For security vulnerabilities, please review [our security policy](../../security/policy).

---

👨‍💻 Credits
-----------

[](#‍-credits)

- [Akram Ghaleb](https://github.com/akramghaleb)
- [All Contributors](../../contributors)

---

📄 License
---------

[](#-license)

This project is open-source software licensed under the **MIT License**.
See [LICENSE](LICENSE.md) for more information.

---

🌍 Support
---------

[](#-support)

If you find this package useful, please ⭐ it on [GitHub](https://github.com/akramghaleb/laravel-grandstream).
You can also support by sharing feedback, contributing, or improving documentation.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance66

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

205d ago

PHP version history (2 changes)v1.0.0PHP ^8.4

v1.0.1PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e87186291093d43e36fa0aa638a9c5cd99052ba24383fe3009c1b986ef18b899?d=identicon)[akramghaleb](/maintainers/akramghaleb)

---

Top Contributors

[![akramghaleb](https://avatars.githubusercontent.com/u/46090581?v=4)](https://github.com/akramghaleb "akramghaleb (26 commits)")

---

Tags

laravelgrandstreamAkram Ghaleblaravel-grandstream

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/akramghaleb-laravel-grandstream/health.svg)

```
[![Health](https://phpackages.com/badges/akramghaleb-laravel-grandstream/health.svg)](https://phpackages.com/packages/akramghaleb-laravel-grandstream)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
