Getting Asterisk status from java code

I have to get the status of the asterisk running in a Linux PC , from my windows PC using a java program. Is there any possibilites of getting the status of asterisk status ( like connected , not connected etc…,) from a external machine . Waiting for the help …

Thanks in adavance.

Look at the code on Freepbx, they use PHP for determining the asterisk status.


thanks for your reply. Sorry iam not aware of what freePbx is …can u some more details abt that or any link to check it.

thanks in advance.

java asterisk agi api example
Need to customize for your requirements

lookup freepbx also known as asterisk@home - asterisk@home kinda merged into freepbx. Freepbx is much more mature.

or off of


As far as I know freePBX has no java code.
The person wants the status of asterisk using java code.
So the mechansim should be Manager API through java.
Don’t confuse people.

With Asterisk-Java 0.3-m1 receiving a list of active channels is as simple as:

AsteriskServer server = new DefaultAsteriskServer("pbx0", "manager", "pa55w0rd"); for (AsteriskChannel channel : server.getChannels()) { System.out.println(channel); }

Is that what you call “status”?

thanks vinod . I am looking at the Manager API. Hope this will help me…
will get back to you if found any problem.

quite untrue. A@H turned into TrixBox and would appear to be more troublesome with every release. great concept though.

FreePBX used to be AMP … i went off AMP before they made the daft name change … since when can a GUI be called a PBX ??

thanks str. The status i mean is to get the connection status i.e. the running status. I need to check that the asterisk is running in the Linux machine or not and if it is running then i have to get the call details as u mentioned.

I got it worked by using “asterisk-java” manager API.
The API documenation helped me a lot. Nowi can able to get the connection status and i can also send command to the asterisk server from my windows PC.

Thanks for all your help.