PHPackages                             freeswitch/php-client - 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. freeswitch/php-client

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

freeswitch/php-client
=====================

基于swoole做的FreeSWTICH tcp 客户端

v1.1.0(4y ago)8881MITPHPPHP &gt;=7.2

Since Mar 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/luoyumin/php-freeswitch-client)[ Packagist](https://packagist.org/packages/freeswitch/php-client)[ RSS](/packages/freeswitch-php-client/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (9)DependenciesVersions (11)Used By (0)

freeSWITCH-client
=================

[](#freeswitch-client)

简介
--

[](#简介)

freeSWITCH-client是基于php swoole扩展协程通过tcp协议实现的freeSWITCH的客户端，已实现对基本接口的封装。例如验证网关有效性，普通双方通话外呼接口及事件监听等等接口。同时实现了简单的异常断开重连，重启事件监听。

说明
--

[](#说明)

需要监听事件则需要需自行实现\\FreeSwitch\\Event\\EventHandleInterface，并通过事件监听接口(\\FreeSwitch\\FreeSwitch-&gt;eventListening或\\FreeSwitch\\FreeSwitch-&gt;setEventHandleObject)将处理事件类注入。需要注意的是处理事件类以及连接freeSWITCH是阻塞的。想要退出阻塞的时间监听可以调用\\FreeSwitch\\FreeSwitch-&gt;close方法即可。

实例\\FreeSwitch\\FreeSwitch需要传入你的FreeSwitch服务配置信息，host、port、password以及timeout(连接超时时间)。

你可以通过\\FreeSwitch\\FreeSwitch提供的各种方法去设置呼叫所需的必须或者自定义参数，你甚至可以通过代理方法调用“底层”的公用接口方法。

简单示例
----

[](#简单示例)

```
class example implements \FreeSwitch\Event\EventHandleInterface {

    /**
     * @param array $event_recv 监听事件返回的包
     */
    public function process(array $event_recv)
    {
        // todo
    }

    /**
     * 外呼接口
     */
    function outbound()
    {
        $caller = '****'; // 被叫
        $callee = '****'; // 主叫

        $fs = new \FreeSwitch\FreeSwitch(['host'=>'127.0.0.1','port'=>'12345','password'=>'******']);

        $fs->startCall($caller, $callee); // 开始呼叫

        // 退出事件监听示例(或者其他方式调用，不在同一协程下不会被阻塞，但是得注意您的上下文关系，避免造成变量污染或内存泄漏等问题)
        Timer::after(1000,function ()use ($freeSwitch){
            $freeSwitch->close();
        });

        $fs->eventListening($this); // 事件监听，并注入事件处理类(注意:监听事件是阻塞的)
    }
}

```

`QQ:827871186`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Recently: every ~26 days

Total

9

Last Release

1792d ago

### Community

Maintainers

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

---

Top Contributors

[![luoyumin](https://avatars.githubusercontent.com/u/28485346?v=4)](https://github.com/luoyumin "luoyumin (41 commits)")

### Embed Badge

![Health badge](/badges/freeswitch-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/freeswitch-php-client/health.svg)](https://phpackages.com/packages/freeswitch-php-client)
```

###  Alternatives

[michael-rubel/laravel-couponables

This package provides polymorphic coupon functionality for your Laravel application.

19590.7k1](/packages/michael-rubel-laravel-couponables)[loadsys/cakephp_sitemap

A CakePHP Plugin for adding automatic XML and HTML Sitemaps to an app

2819.6k](/packages/loadsys-cakephp-sitemap)[mauricerenck/komments

A comment and webmention plugin for Kirby 3

501.2k1](/packages/mauricerenck-komments)[myweb/show-out-of-stock-products

Show out-of-stock product configurations for configurable products on the front end.

131.7k](/packages/myweb-show-out-of-stock-products)

PHPackages © 2026

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