invit/plivo-bundle

Plivo PHP 库服务包

2.4 2021-02-17 09:24 UTC

This package is auto-updated.

Last update: 2024-08-26 15:57:18 UTC


README

此包为官方 Plivo PHP 辅助库创建了一个 Symfony 包装服务

安装

composer require invit/plivo-bundle

同时,在 bundles.php 中启用此包

<?php
// config/bundles.php

return [
    ...
    Invit\PlivoBundle\InvitPlivoBundle::class => ['all' => true],
    ...
];

使用您在 Plivo 控制台 中找到的凭据配置应用程序。

invit_plivo:
    auth:
        auth_id:      "xxxxx"
        auth_token:   "yyyyy"

示例

$this->get(PlivoApi::class)->calls->play(
    'cf5fe5ff-9952-yyyy-xxxx-b75ff490ffff', 
    ['https://s3-eu-west-1.amazonaws.com/waitsongbucket/wait.mp3'], 
    [
        'loop' => 'true',
        'mix' => 'false',
        'legs' => 'both',
    ]
);