PHP Class PHPDaemon\Clients\Asterisk\Connection

Inheritance: extends PHPDaemon\Network\ClientConnection
Afficher le fichier Open project: kakserpom/phpdaemon

Méthodes publiques

Свойство Type Description
$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

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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:

Method Details

action() public méthode

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
Résultat void

auth() protected méthode

Send authentication packet
protected auth ( ) : void
Résultat void

challenge() protected méthode

Action: Challenge Synopsis: Generate Challenge for MD5 Auth Privilege:
protected challenge ( callable $cb ) : void
$cb callable
Résultat void

command() protected méthode

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() public méthode

Variables: ActionID: Optional Action id for message matching.
public coreShowChannels ( callable $cb ) : void
$cb callable
Résultat void

extensionState() public méthode

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
Résultat void

getConfig() public méthode

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
Résultat void

getConfigJSON() public méthode

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
Résultat void

getIaxPeers() public méthode

Action: IAXpeerlist Synopsis: List IAX Peers Privilege: system,reporting,all
public getIaxPeers ( callable $cb ) : void
$cb callable Callback called when response received
Résultat void

getSipPeers() public méthode

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
Résultat void

gracefulShutdown() public méthode

Called when the worker is going to shutdown
public gracefulShutdown ( ) : boolean
Résultat boolean Ready to shutdown?

implodeParams() protected méthode

Generate AMI packet string from associative array provided
protected implodeParams ( array $params ) : string
$params array
Résultat string

login() protected méthode

Action: Login Synopsis: Login Manager Privilege:
protected login ( ) : void
Résultat void

logoff() public méthode

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
Résultat void

onConnected() public méthode

Execute the given callback when/if the connection is handshaked
public onConnected ( $cb ) : void
Résultat void

onEvent() public méthode

Called when event occured
Deprecation: Replaced with ->bind('event', ...)
public onEvent ( callable $cb ) : void
$cb callable Callback
Résultat void

onFinish() public méthode

Called when session finishes
public onFinish ( ) : void
Résultat void

onRead() public méthode

Called when new data received
public onRead ( ) : void
Résultat void

onReady() public méthode

Called when the connection is handshaked (at low-level), and peer is ready to recv. data
public onReady ( ) : void
Résultat void

originate() public méthode

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
Résultat void

ping() public méthode

Variables: NONE
public ping ( callable $cb ) : void
$cb callable Callback called when response received
Résultat void

redirect() public méthode

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
Résultat void

setVar() public méthode

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
Résultat void

status() public méthode

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
Résultat void

Property Details

$EOL public_oe property

EOL
public $EOL

$assertions public_oe property

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
Résultat array

$callbacks public_oe property

Stack of callbacks called when response received
public $callbacks

$cnt public_oe property

For composite response on action
public $cnt

$instate public_oe property

Input state
public $instate

$onChallenge public_oe property

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

$packets public_oe property

Received packets
public $packets

$secret public_oe property

The password defined in manager interface of server
public $secret

$state public_oe property

Connection's state
public $state

$username public_oe property

The username to access the interface
public $username