I want to retrieve the SIP users list from Asterisk server onto the SIP client. Asterisk-java API can be used for this purpose but I am not clear on how should I do that? I need to send Action "SIPpeers" to Asterisk AMI which in turn would return SIP peers list.I am confused whether I should run the Java program firing 'SIPpeers' action on the Asterisk server or on the client machine?
import org.asteriskjava.fastagi.AgiChannel;
import org.asteriskjava.fastagi.AgiException;
import org.asteriskjava.fastagi.AgiRequest;
import org.asteriskjava.fastagi.BaseAgiScript;
public class HelloAgiScript extends BaseAgiScript
{
public void service(AgiRequest request, AgiChannel channel)
throws AgiException
{
// Answer the channel...
answer();
// ...say hello...
streamFile("welcome");
// ...and hangup.
hangup();
}
}
Please Help me out. Thank You!