fbarachino/kalliopepbx 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

fbarachino/kalliopepbx

最新稳定版本:1.0.1

Composer 安装命令:

composer require fbarachino/kalliopepbx

包简介

Helper to consume Kalliope's RestAPI

README 文档

README

Package per Laravel per utilizzare le RestAPI del Kalliope PBX

Usage

To use this package for laravel, follow the steps below:

  1. Install the package via Composer:

    composer require fbarachino/kalliopepbx
  2. Publish the config file:

    php artisan vendor:publish --tag=kalliopepbx-config

    and edit it with correct values.

  3. Initialize and configure the library as needed (for example):

    ...
    use Illuminate\Support\Facades\Storage;
    use fbarachino\kalliopepbx\KalliopePbx;
    
    class RestApiCall {
    
        public static function getSerialNumber()
        {
            $kalliope = new KalliopePbx();
            $response = $kalliope->sendRequest('rest/dashboard/serialNumber','GET');
            return $response;
        }
       
       // remeber to execute 'php artisan storage:link'
        public static function backup($filename, $description)
        {
            $kalliope = new KalliopePbx();
            $firmware = $kalliope->sendRequest('/rest/dashboard/firmwareVersion','GET');
            $data = 
            [
                'backup'=>
                [
                    'filename' => $filename,
                    'comment' => $description
                ],
            ];
    
            $response = json_decode($kalliope->sendRequest('rest/backup/create/'.$firmware,'POST',$data);
            return Storage::disk('local')->put('/public/backup/kalliope/'.$filename.'.bak', $response);         
        } 
    
    }
    ...
  4. You can use the helper as:

    $kalliope->sendRequest($url,$method,$data);

    Where $url is the URL of the API request, $method is the method (GET,POST,PUT,PATCH,DELETE), and $data is the array of fields.

From version 1.0.1 you can also instantiate directly if you don't want to use the config/kalliopepbx.php file:

...
$kalliope = new KalliopePbx($address,$port,$protocol,$username,$password);
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-14