0

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!

Pankaj
  • 41
  • 2
  • 7

1 Answers1

0

You have use AMI, not agi for that.

Please read again doc.

arheops
  • 15,544
  • 1
  • 21
  • 27
  • arheops...please can you suggest exact way of doing this. I am not getting any precise information. All I know how to do this from Telnet, but later on I read that Astersik-Java can achieve similar things by firing AMI commands. Please help me! – Pankaj Mar 09 '14 at 16:40