cloudonix/cxml-php
Composer 安装命令:
composer require cloudonix/cxml-php
包简介
A PHP Wrapper library for Cloudonix's CXML language
README 文档
README
Documentation
The documentation for the Cloudonix CXML markup language can be found here.
The PHP library documentation can be found here
Supported PHP Versions
This library supports the following PHP versions:
- PHP 8.0
- PHP 8.1
- PHP 8.2
- PHP 8.3
Installation
You can install cxml-php via composer or by downloading the source.
composer require cloudonix/cxml-php
Test your installation
Here is a sample PHP script that will generate a CXML Voice Application document, using the library:
<?php require(__DIR__ . "/vendor/autoload.php"); use Cloudonix\CXML\Response; $responder = new Response(); $responder->dial("12127773456"); $responder->redirect("https://example.com/script.php"); $responder->gather([ (new Response())->play("https://example.com/playfile.mp3")->attributes(["loop" => 3]), (new Response())->pause()->attributes(["length" => 5]), ])->attributes(["action" => "https://example.com/script.php"]); $responder->hangup(); echo $responder;
Copy&Paste the above script to a new file, and execute it from the command line, the following should be the result:
$ php cxmlResponder.php <Response> <DIAL>12127773456</DIAL> <REDIRECT>https://example.com/script.php</REDIRECT> <GATHER action="https://example.com/script.php"> <PLAY loop="3">https://example.com/playfile.mp3</PLAY> <PAUSE length="5" /> </GATHER> <HANGUP /> </Response>
Usage
Create a CXML Document Response with a <PLAY> and <HANGUP>
<?php require(__DIR__ . "/vendor/autoload.php"); use Cloudonix\CXML\Response; $responder = new Response(); $responder ->play("https://example.com/playfile.mp3") ->attributes([ "loop" => 3, "statusCallback" => "https://example.com/statusCallback" ]); $responder->hangup(); echo $responder;
Expected result:
<Response> <PLAY loop="3" statusCallback="https://example.com/statusCallback">https://example.com/playfile.mp3</PLAY> <HANGUP /> </Response>
Create a CXML Document Response with a <GATHER>, <PLAY>, <PAUSE> and <HANGUP>
<?php require(__DIR__ . "/vendor/autoload.php"); use Cloudonix\CXML\Response; $responder = new Response(); $responder->gather([ (new Response())->play("https://example.com/playfile.mp3")->attributes(["loop" => 3]), (new Response())->pause()->attributes(["length" => 5]), ])->attributes(["action" => "https://example.com/script.php"]); $responder->hangup(); echo $responder;
Expected result:
<Response> <GATHER action="https://example.com/script.php"> <PLAY loop="3">https://example.com/playfile.mp3</PLAY> <PAUSE length="5" /> </GATHER> <HANGUP /> </Response>
Getting help
If you need help installing or using the library, please check the Cloudonix Developers Website first.
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
cloudonix/cxml-php 适用场景与选型建议
cloudonix/cxml-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「ivr」 「voice」 「cxml」 「cloudonix」 「voiceai」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cloudonix/cxml-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cloudonix/cxml-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cloudonix/cxml-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Asterisk REST Interface (ARI) client for PHP.
Twilio API for Laravel
TeleSign SDK for PHP
TeleSign Enterprise SDK
Client library for connecting to SignalWire.
PHPAGI is a PHP class for the Asterisk Gateway Interface. The package is available for use and distribution under the terms of the GNU Public License.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-28