徐玛/徐玛包

BFXM Json Builder

1.0.1 2017-01-27 14:13 UTC

This package is auto-updated.

Last update: 2024-09-22 06:17:08 UTC


README

composer require xuma/bfxm dev-master

###使用方法

您可以链式调用方法。

use Xuma\Bfxm\Builder;

$bfxm = new Builder;

$bfxm->play('http://bfxmdemo.bulutfon.com/demosesler/demo-hosgeldiniz.mp3')
	->dial(10)
	->build();

默认情况下,如果您想设置json头部并输出以下代码,只需使用build(true)。

{
    "bfxm": {
        "version": 1
    },
    "seq": [
        {
            "action": "play",
            "args": {
                "url": "http://bfxmdemo.bulutfon.com/demosesler/demo-hosgeldiniz.mp3"
            }
        },
        {
            "action": "dial",
            "args": {
                "destination": 10
            }
        }
    ]
}

###方法

  • play($url)

  • collect

  • 挂断

  • 拒绝

  • 设置调用者

  • 拨号