PHP Class PAGI\Client\Impl\ClientImpl

PHP Version 5
Author: Marcelo Gornstein ([email protected])
Inheritance: extends PAGI\Client\AbstractClient
Afficher le fichier Open project: marcelog/pagi Class Usage Examples

Méthodes publiques

Méthode Description
getInstance ( array $options = [] ) : ClientImpl Returns a client instance for this call.

Méthodes protégées

Méthode Description
__construct ( array $options = [] ) : void Constructor.
close ( ) : void Closes the connection to agi.
open ( ) : void Opens connection to agi. Will also read initial channel variables given by asterisk when launching the agi.
read ( ) : string Reads input from asterisk.
send ( string $text ) : Result Sends a command to asterisk. Returns an array with: [0] => AGI Result (3 digits) [1] => Command result [2] => Result data.

Method Details

__construct() protected méthode

Note: The client accepts an array with options. The available options are stdin => Optional. If set, should contain an already open stream from where the client will read data (useful to make it interact with fastagi servers or even text files to mock stuff when testing). If not set, stdin will be used by the client. stdout => Optional. Same as stdin but for the output of the client.
protected __construct ( array $options = [] ) : void
$options array Optional properties.
Résultat void

close() protected méthode

Closes the connection to agi.
protected close ( ) : void
Résultat void

getInstance() public static méthode

Returns a client instance for this call.
public static getInstance ( array $options = [] ) : ClientImpl
$options array Optional properties.
Résultat ClientImpl

open() protected méthode

Opens connection to agi. Will also read initial channel variables given by asterisk when launching the agi.
protected open ( ) : void
Résultat void

read() protected méthode

Reads input from asterisk.
protected read ( ) : string
Résultat string

send() protected méthode

Sends a command to asterisk. Returns an array with: [0] => AGI Result (3 digits) [1] => Command result [2] => Result data.
protected send ( string $text ) : Result
$text string Command
Résultat Result