PHP 클래스 PHPDaemon\Clients\Asterisk\Connection

상속: extends PHPDaemon\Network\ClientConnection
파일 보기 프로젝트 열기: kakserpom/phpdaemon

공개 프로퍼티들

프로퍼티 타입 설명
$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