Class AsteriskManager

Description

Class for accessing the Asterisk Manager interface http://www.voip-info.org/wiki/view/Asterisk+manager+API

Located in /asterisk.php (line 57)


	
			
Variable Summary
string $password
integer $port
string $server
string $username
Method Summary
AsteriskManager __construct (string $server, string $username, string $password, [integer $port = 5038])
bool close ()
string|bool command (string $command)
string|bool iaxPeers ()
bool login ()
bool logout ()
bool monitor (string $channel, string $filename, string $format, [integer $mix = null])
bool originateCall (string $extension, string $channel, string $context, string $cid, [integer $priority = 1], [integer $timeout = 30000], [array $variables = null], [string $action_id = null])
bool ping ()
bool queueAdd (string $queue, string $handset, integer $penalty)
bool queueRemove (string $queue, string $handset)
string|bool queues ()
string|bool sipPeers ()
string|string status ([string $channel = null])
bool stopMonitor (string $channel)
Variables
string $password (line 85)

The password used to access the Asterisk manager interface

integer $port = 5038 (line 71)

The port to use when connecting to the Asterisk server

string $server (line 64)

The Asterisk server which will recieve the manager commands

string $username (line 78)

The username to access the Asterisk manager interface

Methods
Constructor __construct (line 108)

Class constructor

AsteriskManager __construct (string $server, string $username, string $password, [integer $port = 5038])
  • string $server: The server hostname or IP address
  • string $username: Username credential for the manager interface
  • string $password: The password for the manager interface
  • integer $port: The port the interface is listening on
close (line 168)

Just kill the connection without logging off

bool close ()
command (line 184)

Send a command to the Asterisk CLI interface

string|bool command (string $command)
  • string $command: Command to execute on server
iaxPeers (line 408)

Return a list of IAX peers and their status

string|bool iaxPeers ()
login (line 136)

Login into Asterisk Manager interface

bool login ()
logout (line 153)

Logout of the current manager session attached to $this::socket

bool logout ()
monitor (line 331)

Monitor(record) a channel to given file in given format

bool monitor (string $channel, string $filename, string $format, [integer $mix = null])
  • string $channel: Channel to monitor (e.g. SIP/234, ZAP/1)
  • string $filename: The filename to save to
  • string $format: The format of the file (e.g. gsm, wav)
  • integer $mix: Boolean 1 or 0 on whether to mix
originateCall (line 230)

Make a call to an extension with a given channel acting as the originator

bool originateCall (string $extension, string $channel, string $context, string $cid, [integer $priority = 1], [integer $timeout = 30000], [array $variables = null], [string $action_id = null])
  • string $extension: The extension to use on connection
  • string $channel: The channel where you wish to originate the call
  • string $context: The context that the call will be dropped into
  • string $cid: The caller ID to use
  • integer $priority: The priority of this command
  • integer $timeout: Timeout in milliseconds before attempt dropped
  • array $variables: An array of variables to pass to Asterisk
  • string $action_id: A unique identifier for this command
ping (line 199)

A simple 'ping' command which the server responds with 'pong'

bool ping ()
queueAdd (line 285)

Add a handset to a queue on the server

bool queueAdd (string $queue, string $handset, integer $penalty)
  • string $queue: The name of the queue you wish to add the handset too
  • string $handset: The handset to add, e.g. SIP/234
  • integer $penalty: Penalty
queueRemove (line 310)

Remove a handset from the given queue

bool queueRemove (string $queue, string $handset)
  • string $queue: The queue you wish to perform this action on
  • string $handset: The handset you wish to remove (e.g. SIP/200)
queues (line 265)

Returns a list of queues and their status

string|bool queues ()
sipPeers (line 392)

Get a list of SIP peers and their status

string|bool sipPeers ()
status (line 376)

Get the status information for a channel

string|string status ([string $channel = null])
  • string $channel: The channel to query
stopMonitor (line 358)

Stop monitoring a channel

bool stopMonitor (string $channel)
  • string $channel: The channel you wish to stop monitoring

Documentation generated on Fri, 21 Mar 2008 15:36:30 +0000 by phpDocumentor 1.4.1