承接 ritch/ami-monitor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ritch/ami-monitor

Composer 安装命令:

composer require ritch/ami-monitor

包简介

README 文档

README

This is a new colaboration of asterisk AMI with PHP.

Donate

Help this project grow. Has many things to improve. Donate

Instalation

Via Composer just run composer require ritch/ami-monitor or clone this repository via Github.

Run composer install if you cloned the project by git directly

Run npm install

I Will improve this code and this explication, I swear, but if you only read this code, mainly monitorManager.php or run php monitorManager.php, You can use.

Configuration

  1. Copy the config.ini.sample to config.ini and put your configs

To Run

  1. If you want use web socket, run node webSocketServer.js, dont forget to put the configuration in config.ini.
  2. Copy samples to your base directory cp -rf vendor/ritch/ami-monitor/samples . or make your self monitor.
  3. Run php samples/monitorManager.php
  4. Has a file index.html in samples folder, if you has using web socket, and all right, you'll start receive the events on your web page.

Custom File monitor example:

<?php 

namespace App;

//The path of autoload
include 'vendor/autoload.php';

use App\WebSocket;
use App\Ami;

set_time_limit(0);

$webSocket = new WebSocket();
$ami = new Ami();

//Filter some events or show All;
$event = [
	'All',
      /*'AgentLogin',
	'Hangup',
	'BridgeEnter',
	'AgentConnect',
	*/
];

do {
    switch ( @$amiEvent->Event ) {
	//If you has filtering some event, here you can do your logic, or send to websocket,
	case "Hangup":
		// You code here.
		$amiEvent = $ami->getEvent($event);
		$webSocket->emit( "MyCustomAction", [ $amiEvent ] );
		print_r($amiEvent);
	break;

	case "AgentConnect":
		// You code here.
	break;

	default:
		$amiEvent = $ami->getEvent($event);
		$webSocket->emit( "ami", [ $amiEvent ] );
		print_r($amiEvent);
	break;
     }
}
while ( Utils::check_asterisk_status() );

?>

Donate

Help this project grow. Has many things to improve.

Donate

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-09-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固