定制 plinker/asterisk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plinker/asterisk

最新稳定版本:v0.3.6

Composer 安装命令:

composer require plinker/asterisk

包简介

An Asterisk component which hooks into the Asterisk Management Interface on remote systems.

README 文档

README

!!! This component is no longer being actively developed, though bugs will be fixed if reported.

An Asterisk component which hooks into the Asterisk Management Interface (AMI) on remote systems. Using it adds additional layer of security as you can now lock down AMI to listen on only on localhost.

Install

Require this package with composer using the following command:

$ composer require plinker/asterisk

Client

Creating a client instance is done as follows:

<?php
require 'vendor/autoload.php';

/**
 * Initialize plinker client.
 *
 * @param string $server - URL to server listener.
 * @param string $config - server secret, and/or a additional component data
 */
$client = new \Plinker\Core\Client(
    'http://example.com/server.php',
    [
        'secret' => 'a secret password',
        'database' => [
            'dsn' => 'mysql:host=127.0.0.1;dbname=asterisk',
            'username' => '',
            'password' => '',
            'database' => '',
            'freeze' => false,
            'debug' => false
        ],
        'ami' => [
            'server' => '127.0.0.1',
            'port' => '5038',
            'username' => '',
            'password' => ''
        ]
    ]
);

// or using global function
$client = plinker_client('http://example.com/server.php', 'a secret password', [
    'database' => [
        'dsn' => 'mysql:host=127.0.0.1;dbname=asterisk',
        'username' => '',
        'password' => '',
        'database' => '',
        'freeze' => false,
        'debug' => false
    ],
    'ami' => [
        'server' => '127.0.0.1',
        'port' => '5038',
        'username' => '',
        'password' => ''
    ]
]);

Methods

Once setup, you call the class though its namespace to its method.

Command

Execute ASM command.

Call

$result = $client->asterisk->command('sip show peers');

Response


Get Queue

Connect into AMI and issue asterisk command [queue show *].

Call

$result = $client->asterisk->getQueue('foo');

Response


Show Channels

Connect into AMI and issue asterisk command [core show channels].

Call

$result = $client->asterisk->coreShowChannels();

Response

Array
(
    'active_channels' => 0,
    'active_calls' => 0,
    'calls_processed' => 0
}

And other methods see: vendor/asterisk/src/Asterisk.php

Testing

There are no tests setup for this component.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please contact me via https://cherone.co.uk instead of using the issue tracker.

Credits

Development Encouragement

If you use this project and make money from it or want to show your appreciation, please feel free to make a donation https://www.paypal.me/lcherone, thanks.

Sponsors

Get your company or name listed throughout the documentation and on each github repository, contact me at https://cherone.co.uk for further details.

License

The MIT License (MIT). Please see License File for more information.

See the organisations page for additional components.

统计信息

  • 总下载量: 310
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固