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 …
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);
}
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.