Skip to content
PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



PAMI means PHP Asterisk Manager Interface. As its name suggests its just a
set of php classes that will let you issue commands to an ami and/or receive
events, using an observer-listener pattern.

The idea behind this, is to easily implement operator consoles, monitors, etc.
either via SOA or ajax.

Currently there is no manual or comprehensive documentation, so please refer
to the examples, it's really all there (I will write the documentation as
soon as possible). Please contact me if you have any comments, doubts, or
any kind of feedback. Send an email to:

Checkout the api (phpdoc) at:

You may want to take a look at Ding if you're
interested in using DI, AOP, and other stuff in your telephony applications.

Asterisk versions supported
PAMI is tested in asterisk 1.6 versions, just because this is the version
I use in my boxes. If you need support for other versions, please contact me.

Please see docs/examples/quickstart/example.php for a very basic example.

Currently Supported Events
More events will be added with time. I can only add the ones I can test for and
use, so your contributions may make the difference! ;)

Unknown (not yet implemented) events will be reported as UnknownEvent, so you
can still catch them. If you catch one of these, please report it!

* AgentsComplete
* Agentlogin
* Agentlogoff
* AGIExec
* Bridge
* ChannelUpdate
* CoreShowChannel
* CoreShowChannelComplete
* DAHDIShowChannel
* DAHDIShowChannelsComplete
* DBGetResponse
* Dial
* Extension
* Hangup
* Hold
* ListDialplan
* Masquerade
* NewAccountCode
* NewCallerid
* Newchannel
* Newexten
* Newstate
* ParkedCallsComplete
* PeerEntry
* PeerlistComplete
* PeerStatus
* QueueMember
* QueueMemberPause
* QueueMemberStatus
* QueueParams
* QueueStatusComplete
* QueueSummaryComplete
* RegistrationsComplete
* Rename
* RTCPReceived
* RTCPReceiver
* RTCPSent
* RTPReceiverStat
* RTPSenderStat
* ShowDialPlanComplete
* Status
* StatusComplete
* Transfer
* Unlink
* VarSet
* VoicemailUserEntry
* VoicemailUserEntryComplete
Currently Supported Actions
* AbsoluteTimeout
* Agents
* AgentLogoff
* Atxfer (asterisk 1.8?)
* Bridge
* ChangeMonitor
* Command
* CoreSettings
* CoreShowChannels
* CoreStatus
* DAHDIDialOffHookAction
* DAHDIHangup
* DAHDIRestart
* DAHDIShowChannels
* DBGet
* DBPut
* DBDel
* DBDelTree
* ExtensionState
* CreateConfig
* GetConfig
* GetConfigJSON
* GetVar
* Hangup
* JabberSend
* LocalOptimizeAway
* Login
* Logoff
* ListCategories
* ListCommands
* MailboxCount
* MailboxStatus
* MeetmeList
* MeetmeMute
* MeetmeUnmute
* ModuleCheck
* ModuleLoad (split in ModuleLoad, ModuleUnload, and ModuleReload)
* Monitor
* Originate
* ParkedCalls
* PauseMonitor
* Ping
* PlayDTMF
* Queues
* QueueAdd
* Queue
* QueueLog
* QueuePause
* QueuePenalty
* QueueReload
* QueueRemove
* QueueReset
* QueueRule
* QueueSummary
* QueueStatus
* QueueUnpause
* Redirect
* Reload
* SendText
* SetVar
* ShowDialPlan
* Sipnotify
* Sippeers
* Sipqualifypeer
* Sipshowpeer
* Sipshowregistry
* Status
* StopMonitor
* UnpauseMonitor
* VoicemailUsersList
* build.xml is a phing build file, not ant.
* It's very possible that you may need to edit
* Available main targets: all, build, test, report.
* Tools run: phpdoc, phploc, phpcs, phpmd, phpcpd, phpdepend, phpunit.
Debugging, logging

You need log4php ( if you want debugging
output from the container. Just make sure you copy it to the include_path and
PAGI will pick it up from there.

This means that this is NOT A REQUIREMENT FOR A DEPLOY. It's not even a
requirement at develop time (except when you really want debug output).
You can use the included example of a file in

Of course it is recommended that you do not set DEBUG output in your log4php
configuration (or remove it from the include path so PAGI will notice and not
use it). This *will* create a difference in performance.
Copyright 2011 Marcelo Gornstein <>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
To Jason Blank <rumpled at github> for helping in the debugging of the queue
functionality and some other ami inconsistencies.
Something went wrong with that request. Please try again.