PHPackages                             khody2012/laravel-ami-toolkit - 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. khody2012/laravel-ami-toolkit

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

khody2012/laravel-ami-toolkit
=============================

A powerful and developer-friendly Laravel package that provides seamless integration with Asterisk AMI (Asterisk Manager Interface).

v0.6.0.35(2mo ago)117MITPHPPHP ^8.1

Since Feb 3Pushed 2mo agoCompare

[ Source](https://github.com/khody2012/LaravelAmiToolkit)[ Packagist](https://packagist.org/packages/khody2012/laravel-ami-toolkit)[ RSS](/packages/khody2012-laravel-ami-toolkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (16)Used By (0)

Laravel AMI Toolkit
===================

[](#laravel-ami-toolkit)

🚀 **Laravel AMI Toolkit** is a powerful, developer-friendly Laravel package for seamless integration with the **Asterisk Manager Interface (AMI)**.

It provides clean abstractions and expressive APIs to connect to Asterisk, listen to AMI events, and send manager commands — all while staying idiomatic to Laravel’s ecosystem.

This package is designed for **real-time**, **event-driven** telephony applications such as CRMs, call centers, monitoring dashboards, and VoIP-based services.

---

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

[](#-features)

- 🔌 Persistent and configurable connection to Asterisk AMI
- 📡 Listen to real-time AMI events (Dial, Hangup, Queue, etc.)
- ⚡ Send AMI actions (Originate, Hangup, Ping, Command, …)
- 🧩 Laravel Event &amp; Listener integration
- 🧪 Testable architecture with mockable components
- 🛠️ Clean, extensible, and well-structured codebase
- 🔒 Secure authentication handling
- 📦 Laravel auto-discovery support

---

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

[](#-installation)

Install the package via Composer:

```
composer require khody2012/laravel-ami-toolkit
```

---

⚡ Requirements
--------------

[](#-requirements)

- PHP 8.1+
- Laravel 9.x, 10.x, 11.x, 12.x

---

⚙️ Configuration
----------------

[](#️-configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=ami-config
```

This will create `config/ami.php`.

### Example configuration

[](#example-configuration)

```
return [
    'host' => env('AMI_HOST', '127.0.0.1'),
    'port' => env('AMI_PORT', 5038),
    'username' => env('AMI_USERNAME'),
    'password' => env('AMI_PASSWORD'),
    'timeout' => 5,
    'auto_reconnect' => true,
];
```

Add the following variables to your `.env` file:

```
AMI_HOST=127.0.0.1
AMI_PORT=5038
AMI_USERNAME=admin
AMI_PASSWORD=secret
```

---

🚀 Basic Usage
-------------

[](#-basic-usage)

### Connecting to Asterisk AMI

[](#connecting-to-asterisk-ami)

```
use Khody2012\LaravelAmiToolkit\Facades\Ami;

Ami::connect();
$response = Ami::ping();

if ($response->isSuccess()) {
    // Connection alive
}
```

---

📞 AMI Actions
-------------

[](#-ami-actions)

### Originate a Call

[](#originate-a-call)

```
Ami::originate([
    'Channel'  => 'SIP/1000',
    'Context'  => 'default',
    'Exten'    => '1001',
    'Priority' => 1,
    'Timeout'  => 30000,
]);
```

### Execute a raw AMI command

[](#execute-a-raw-ami-command)

```
Ami::command('sip show peers');
```

---

### Available Events (examples)

[](#available-events-examples)

- `AmiDialEvent`
- `AmiHangupEvent`
- `AmiNewChannelEvent`
- `AmiQueueMemberEvent`
- `AmiBridgeEvent`

> You can easily extend or map new AMI events.

---

🧩 Architecture Overview
-----------------------

[](#-architecture-overview)

- **Connection Layer** – Handles socket communication and authentication
- **Action Layer** – Encapsulates AMI actions
- **Event Layer** – Maps AMI events to Laravel events
- **Facade API** – Clean developer-facing interface

This layered design keeps the package **maintainable**, **testable**, and **extensible**.

---

🔐 Security Notes
----------------

[](#-security-notes)

- Credentials are never logged
- Supports environment-based configuration
- Connection timeouts and reconnection strategies included

---

🛣️ Roadmap
----------

[](#️-roadmap)

- Async / non-blocking event loop
- Queue-based event handling
- Horizon &amp; WebSocket integration
- Dashboard helpers
- Full API documentation website

---

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

[](#-contributing)

Contributions are welcome ❤️

1. Fork the repository
2. Create a feature branch
3. Write tests
4. Submit a pull request

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the **MIT license**.

---

🏷️ Keywords
-----------

[](#️-keywords)

`laravel`, `asterisk`, `ami`, `voip`, `pbx`, `telephony`, `event-driven`, `call-center`, `realtime`

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance83

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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 ~1 days

Total

15

Last Release

87d ago

### Community

Maintainers

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

---

Top Contributors

[![khody2012](https://avatars.githubusercontent.com/u/49361472?v=4)](https://github.com/khody2012 "khody2012 (18 commits)")

---

Tags

asynclaravelreactphpevent-drivenrealtimeasteriskamivoiptelephonypbxcall center

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/khody2012-laravel-ami-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/khody2012-laravel-ami-toolkit/health.svg)](https://phpackages.com/packages/khody2012-laravel-ami-toolkit)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

113154.9k1](/packages/clue-docker-react)[react/promise-timer

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

34141.9M96](/packages/react-promise-timer)[clue/ami-react

Streaming, event-driven access to the Asterisk Manager Interface (AMI), built on top of ReactPHP.

85110.1k10](/packages/clue-ami-react)[clue/reactphp-eventsource

Instant real-time updates. Lightweight EventSource client receiving live messages via HTML5 Server-Sent Events (SSE). Fast stream processing built on top of ReactPHP's event-driven architecture.

5818.5k3](/packages/clue-reactphp-eventsource)[mikopbx/core

Free PBX system for SMB based on Asterisk

5271.4k](/packages/mikopbx-core)

PHPackages © 2026

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