[Asterisk-Users] SIPPeersAction class file not found intheAsterisk-java.jar file

Bharat M. Sarvan bharat.sarvan at ezzibpo.com
Fri Aug 5 06:57:21 MST 2005


Hi Stefan,
          I have all the necessary files for the code to be executed. The
fastagi-mapping.properties file is also correct. But still I am getting the
error for 

No script configured for agi://
 
The IP address is correct and as well as the agi file name. Does it make a
difference giving a Tab or a space when giving the mapping of agi file name
and class file name in the fastagi-mapping.properties file.

Is there any other reason for getting this error....

Please reply
 
 
Regards,
Bharat M. Sarvan
Software Engineer - VoIP
EZZI BPO Pvt Ltd.,
PUNE.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Bharat M.
Sarvan
Sent: Friday, August 05, 2005 2:04 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: RE: [Asterisk-Users] SIPPeersAction class file not found
intheAsterisk-java.jar file

Well thanks Stefan, for the help but when I am executing the AGI script I am
getting the errors as below:

Aug 5, 2005 3:29:44 AM net.sf.asterisk.util.impl.JavaLoggingLog info
INFO: Received connection.
Aug 5, 2005 3:29:45 AM net.sf.asterisk.util.impl.JavaLoggingLog error
SEVERE: Unable to create AGIScript instance of type HelloScript
Aug 5, 2005 3:29:45 AM net.sf.asterisk.util.impl.JavaLoggingLog error
SEVERE: No script configured for agi://65.125.224.207/bharat.agi


What does it mean by "No Script configured for agi://" and can you please
tell me how do I come up with this error?
 
 
  
Regards,
Bharat M. Sarvan
Software Engineer - VoIP
EZZI BPO Pvt Ltd.,
PUNE.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Stefan Reuter
Sent: Friday, August 05, 2005 6:18 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] SIPPeersAction class file not found in
theAsterisk-java.jar file

On Thu, 2005-08-04 at 18:25 +0530, Bharat M. Sarvan wrote:
>                         I am working on Fastagi and I am making use of
> Asterisk-java. But I don't find the class file for SIPPeersAction.

The SIPPeersAction is not part of Asterisk-Java 0.1, it is available in
CVS-HEAD only.
Besides that the action classes in net.sf.asterisk.manager.action can
only be used with the Manager API and not with FastAGI.
So if you want to retrieve a list of sip peers you need to do that via
the Manager API. With Asterisk 1.0.x and Asterisk-Java 0.1 you can do
this via the CommandAction. Only if you are already using Asterisk
CVS-HEAD and Asterisk-Java CVS-HEAD you can use the new SipPeerAction.

Example with CommandAction:

import java.util.Iterator;

import net.sf.asterisk.manager.ManagerConnection;
import net.sf.asterisk.manager.ManagerConnectionFactory;
import net.sf.asterisk.manager.action.CommandAction;
import net.sf.asterisk.manager.response.CommandResponse;

public class Manager
{
    private ManagerConnection c;

    public Manager() throws Exception
    {
        c = new ManagerConnectionFactory().getManagerConnection("host", 
                "user", "pass");
    }

    public void run() throws Exception
    {
        c.login();

        CommandAction action;
        CommandResponse response;
        Iterator lineIterator;

        action = new CommandAction();
        action.setCommand("sip show peers");

        response = (CommandResponse) c.sendAction(action);
        lineIterator = response.getResult().iterator();

        while (lineIterator.hasNext())
        {
            System.out.println(lineIterator.next());
        }
        
        c.logoff();
    }

    public static void main(String[] args) throws Exception
    {
        new Manager().run();
    }
}

This produces something like:

Name/username    Host            Dyn Nat ACL Mask             Port
Status    
1313/1313        10.13.0.61       D       A  255.255.255.255  5061
Unmonitored
1312/1312        10.13.0.61       D       A  255.255.255.255  5061
Unmonitored
1311/1311        10.13.0.61       D       A  255.255.255.255  5061
Unmonitored
1310/1310        (Unspecified)    D       A  255.255.255.255  0
Unmonitored
1303/1303        (Unspecified)    D   N      255.255.255.255  0
Unmonitored
1302/1302        (Unspecified)    D       A  255.255.255.255  0
Unmonitored
1301/1301        (Unspecified)    D       A  255.255.255.255  0
Unmonitored

=Stefan


_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list