PHP Класс PHPDaemon\Clients\Asterisk\Connection

Наследование: extends PHPDaemon\Network\ClientConnection
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$EOL EOL
$assertions array Assertion: if more events may follow as response this is a main part or full an action complete event indicating that all data has been sent
$callbacks Stack of callbacks called when response received
$cnt For composite response on action
$instate Input state
$onChallenge Callback. Called when received response on challenge action
$packets Received packets
$secret The password defined in manager interface of server
$state Connection's state
$username The username to access the interface

Открытые методы

Метод Описание
action ( string $action, callable $cb, array $params = null, array $assertion = null ) : void For almost any actions in Action: ListCommands Privilege: depends on $action
coreShowChannels ( callable $cb ) : void Action: CoreShowChannels Synopsis: List currently active channels Privilege: system,reporting,all Description: List currently defined channels and some information about them.
extensionState ( array $params, callable $cb ) : void Action: ExtensionState Synopsis: Get an extension's state.
getConfig ( string $filename, callable $cb ) : void Action: GetConfig Synopsis: Retrieve configuration Privilege: system,config,all Description: A 'GetConfig' action will dump the contents of a configuration file by category and contents or optionally by specified category only.
getConfigJSON ( string $filename, callable $cb ) : void Action: GetConfigJSON Synopsis: Retrieve configuration Privilege: system,config,all Description: A 'GetConfigJSON' action will dump the contents of a configuration file by category and contents in JSON format. This only makes sense to be used using rawman over the HTTP interface.
getIaxPeers ( callable $cb ) : void Action: IAXpeerlist Synopsis: List IAX Peers Privilege: system,reporting,all
getSipPeers ( callable $cb ) : void Action: SIPpeers Synopsis: List SIP peers (text format) Privilege: system,reporting,all Description: Lists SIP peers in text format with details on current status.
gracefulShutdown ( ) : boolean Called when the worker is going to shutdown
logoff ( callable $cb = null ) : void Action: Logoff Synopsis: Logoff Manager Privilege: Description: Logoff this manager session Variables: NONE
onConnected ( $cb ) : void Execute the given callback when/if the connection is handshaked
onEvent ( callable $cb ) : void Called when event occured
onFinish ( ) : void Called when session finishes
onRead ( ) : void Called when new data received
onReady ( ) : void Called when the connection is handshaked (at low-level), and peer is ready to recv. data
originate ( array $params, callable $cb ) : void Action: Originate Synopsis: Originate a call Privilege: call,all Description: first the Channel is rung. Then, when that answers, the Extension is dialled within the Context to initiate the other end of the call.
ping ( callable $cb ) : void Action: Ping Description: A 'Ping' action will ellicit a 'Pong' response. Used to keep the manager connection open.
redirect ( array $params, callable $cb ) : void Action: Redirect Synopsis: Redirect (transfer) a call Privilege: call,all Description: Redirect (transfer) a call.
setVar ( string $channel, string $variable, string $value, callable $cb ) : void Action: Setvar Synopsis: Set Channel Variable Privilege: call,all Description: Set a global or local channel variable.
status ( callable $cb, string $channel = null ) : void Action: Status Synopsis: Lists channel status Privilege: system,call,reporting,all Description: Lists channel status along with requested channel vars.

Защищенные методы

Метод Описание
auth ( ) : void Send authentication packet
challenge ( callable $cb ) : void Action: Challenge Synopsis: Generate Challenge for MD5 Auth Privilege:
command ( string $packet, callable $cb, array $assertion = null ) Sends arbitrary command
implodeParams ( array $params ) : string Generate AMI packet string from associative array provided
login ( ) : void Action: Login Synopsis: Login Manager Privilege:

Описание методов

action() публичный Метод

For almost any actions in Action: ListCommands Privilege: depends on $action
public action ( string $action, callable $cb, array $params = null, array $assertion = null ) : void
$action string Action
$cb callable Callback called when response received
$params array Parameters
$assertion array If more events may follow as response this is a main part or full an action complete event indicating that all data has been sent
Результат void

auth() защищенный Метод

Send authentication packet
protected auth ( ) : void
Результат void

challenge() защищенный Метод

Action: Challenge Synopsis: Generate Challenge for MD5 Auth Privilege:
protected challenge ( callable $cb ) : void
$cb callable
Результат void

command() защищенный Метод

Sends arbitrary command
protected command ( string $packet, callable $cb, array $assertion = null )
$packet string A packet for sending by the connected client to Asterisk
$cb callable Callback called when response received
$assertion array If more events may follow as response this is a main part or full an action complete event indicating that all data has been sent

coreShowChannels() публичный Метод

Variables: ActionID: Optional Action id for message matching.
public coreShowChannels ( callable $cb ) : void
$cb callable
Результат void

extensionState() публичный Метод

Description: function can be used to retrieve the state from any hinted extension. Variables: (Names marked with * are required) *Exten: Extension to get state Context: Context for exten ActionID: Optional Action id for message matching.
public extensionState ( array $params, callable $cb ) : void
$params array
$cb callable Callback called when response received
Результат void

getConfig() публичный Метод

Variables: (Names marked with * are required) *Filename: Configuration filename (e.g. foo.conf) Category: Category in configuration file
public getConfig ( string $filename, callable $cb ) : void
$filename string Filename
$cb callable Callback called when response received
Результат void

getConfigJSON() публичный Метод

Variables: Filename: Configuration filename (e.g. foo.conf)
public getConfigJSON ( string $filename, callable $cb ) : void
$filename string Filename
$cb callable Callback called when response received
Результат void

getIaxPeers() публичный Метод

Action: IAXpeerlist Synopsis: List IAX Peers Privilege: system,reporting,all
public getIaxPeers ( callable $cb ) : void
$cb callable Callback called when response received
Результат void

getSipPeers() публичный Метод

Peerlist will follow as separate events, followed by a final event called PeerlistComplete. Variables: ActionID: Action ID for this transaction. Will be returned.
public getSipPeers ( callable $cb ) : void
$cb callable Callback called when response received
Результат void

gracefulShutdown() публичный Метод

Called when the worker is going to shutdown
public gracefulShutdown ( ) : boolean
Результат boolean Ready to shutdown?

implodeParams() защищенный Метод

Generate AMI packet string from associative array provided
protected implodeParams ( array $params ) : string
$params array
Результат string

login() защищенный Метод

Action: Login Synopsis: Login Manager Privilege:
protected login ( ) : void
Результат void

logoff() публичный Метод

Action: Logoff Synopsis: Logoff Manager Privilege: Description: Logoff this manager session Variables: NONE
public logoff ( callable $cb = null ) : void
$cb callable Optional callback called when response received
Результат void

onConnected() публичный Метод

Execute the given callback when/if the connection is handshaked
public onConnected ( $cb ) : void
Результат void

onEvent() публичный Метод

Called when event occured
Устаревший: Replaced with ->bind('event', ...)
public onEvent ( callable $cb ) : void
$cb callable Callback
Результат void

onFinish() публичный Метод

Called when session finishes
public onFinish ( ) : void
Результат void

onRead() публичный Метод

Called when new data received
public onRead ( ) : void
Результат void

onReady() публичный Метод

Called when the connection is handshaked (at low-level), and peer is ready to recv. data
public onReady ( ) : void
Результат void

originate() публичный Метод

Variables: (Names marked with * are required) *Channel: Channel on which to originate the call (The same as you specify in the Dial application command) *Context: Context to use on connect (must use Exten & Priority with it) *Exten: Extension to use on connect (must use Context & Priority with it) *Priority: Priority to use on connect (must use Context & Exten with it) Timeout: Timeout (in milliseconds) for the originating connection to happen(defaults to 30000 milliseconds) *CallerID: CallerID to use for the call Variable: Channels variables to set (max 32). Variables will be set for both channels (local and connected). Account: Account code for the call Application: Application to use on connect (use Data for parameters) Data : Data if Application parameter is used ActionID: Optional Action id for message matching.
public originate ( array $params, callable $cb ) : void
$params array
$cb callable Callback called when response received
Результат void

ping() публичный Метод

Variables: NONE
public ping ( callable $cb ) : void
$cb callable Callback called when response received
Результат void

redirect() публичный Метод

Variables: (Names marked with * are required) *Channel: Channel to redirect ExtraChannel: Second call leg to transfer (optional) *Exten: Extension to transfer to *Context: Context to transfer to *Priority: Priority to transfer to ActionID: Optional Action id for message matching.
public redirect ( array $params, callable $cb ) : void
$params array
$cb callable Callback called when response received
Результат void

setVar() публичный Метод

Variables: (Names marked with * are required) Channel: Channel to set variable for *Variable: Variable name *Value: Value
public setVar ( string $channel, string $variable, string $value, callable $cb ) : void
$channel string
$variable string
$value string
$cb callable
Результат void

status() публичный Метод

Variables: (Names marked with * are required) Channel: Name of the channel to query for status Variables: Comma ',' separated list of variables to include ActionID: Optional ID for this transaction Will return the status information of each channel along with the value for the specified channel variables.
public status ( callable $cb, string $channel = null ) : void
$cb callable
$channel string
Результат void

Описание свойств

$EOL публичное свойство

EOL
public $EOL

$assertions публичное свойство

Assertion: if more events may follow as response this is a main part or full an action complete event indicating that all data has been sent
public array $assertions
Результат array

$callbacks публичное свойство

Stack of callbacks called when response received
public $callbacks

$cnt публичное свойство

For composite response on action
public $cnt

$instate публичное свойство

Input state
public $instate

$onChallenge публичное свойство

Callback. Called when received response on challenge action
public $onChallenge

$packets публичное свойство

Received packets
public $packets

$secret публичное свойство

The password defined in manager interface of server
public $secret

$state публичное свойство

Connection's state
public $state

$username публичное свойство

The username to access the interface
public $username