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
Just kill the connection without logging off
bool
close
()
Send a command to the Asterisk CLI interface
string|bool
command
(string $command)
-
string
$command: Command to execute on server
Return a list of IAX peers and their status
string|bool
iaxPeers
()
Login into Asterisk Manager interface
bool
login
()
Logout of the current manager session attached to $this::socket
bool
logout
()
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
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
A simple 'ping' command which the server responds with 'pong'
bool
ping
()
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
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)
Returns a list of queues and their status
string|bool
queues
()
Get a list of SIP peers and their status
string|bool
sipPeers
()
Get the status information for a channel
string|string
status
([string $channel = null])
-
string
$channel: The channel to query
Stop monitoring a channel
bool
stopMonitor
(string $channel)
-
string
$channel: The channel you wish to stop monitoring