510 Invalid or unknown command

Hello all!!

I am trying to make an example work, taken from: asterisk-java.org/development/tutorial.html (Manager API example)

[code]import java.io.IOException;

import org.asteriskjava.manager.AuthenticationFailedException;
import org.asteriskjava.manager.ManagerConnection;
import org.asteriskjava.manager.ManagerConnectionFactory;
import org.asteriskjava.manager.TimeoutException;
import org.asteriskjava.manager.action.OriginateAction;
import org.asteriskjava.manager.response.ManagerResponse;

public class HelloManager
{
private ManagerConnection managerConnection;

public HelloManager() throws IOException
{
    ManagerConnectionFactory factory = new ManagerConnectionFactory(
            "localhost", "manager", "pa55w0rd");

    this.managerConnection = factory.createManagerConnection();
}

public void run() throws IOException, AuthenticationFailedException,
        TimeoutException
{
    OriginateAction originateAction;
    ManagerResponse originateResponse;

    originateAction = new OriginateAction();
    originateAction.setChannel("SIP/John");
    originateAction.setContext("default");
    originateAction.setExten("1300");
    originateAction.setPriority(new Integer(1));
    originateAction.setTimeout(new Integer(30000));

    // connect to Asterisk and log in
    managerConnection.login();

    // send the originate action and wait for a maximum of 30 seconds for Asterisk
    // to send a reply
    originateResponse = managerConnection.sendAction(originateAction, 30000);

    // print out whether the originate succeeded or not
    System.out.println(originateResponse.getResponse());

    // and finally log off and disconnect
    managerConnection.logoff();
}

public static void main(String[] args) throws Exception
{
    HelloManager helloManager;

    helloManager = new HelloManager();
    helloManager.run();
}

}[/code]

The example compiles, the call goes into asterisk, but agi output is:

<SIP/xx.xx.xxx.xx-0000008b>AGI Rx << Asterisk Call Manager/1.1
<SIP/xx.xx.xxx.xx-0000008b>AGI Tx >> 510 Invalid or unknown command
<SIP/xx.xx.xxx.xx-0000008b>AGI Rx << Response: Error
<SIP/xx.xx.xxx.xx-0000008b>AGI Tx >> 510 Invalid or unknown command
<SIP/xx.xx.xxx.xx-0000008b>AGI Rx << Message: Missing action in request
<SIP/xx.xx.xxx.xx-0000008b>AGI Tx >> 510 Invalid or unknown command
WARNING[1229]: chan_sip.c:3780 retrans_pkt: Maximum retries exceeded on transmission xxxxxxxxxxx@xx.xx.xxx.xx for seqno 102 (Critical Response) – See doc/sip-retransmit.txt.
WARNING[1229]: chan_sip.c:3780 retrans_pkt: Maximum retries exceeded on transmission xxxxxxxxxxx@xx.xx.xxx.xx for seqno 102 (Critical Response) – See doc/sip-retransmit.txt.
WARNING[1229]: chan_sip.c:3807 retrans_pkt: Hanging up call xxxxxxxxxxx@xx.xx.xxx.xx - no reply to our critical packet (see doc/sip-retransmit.txt).
WARNING[1229]: chan_sip.c:3807 retrans_pkt: Hanging up call xxxxxxxxxxx@xx.xx.xxx.xx - no reply to our critical packet (see doc/sip-retransmit.txt).

Manager.conf

[general]
enabled =yes
webenabled = yes
port = 5038
bindaddr = 0.0.0.0
displayconnects=yes

[manager]
secret=xxxxxx
permit=0.0.0.0/0.0.0.0 ;allow access to all only while I test :exclamation:
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config

I am using Asterisk 1.6.2.6 and
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b21)
IcedTea Client VM (build 1.7.0-b21, mixed mode)

My asterisk box works, I have tested it (incoming, outgoing calls, DID). Where have I gone wrong??

I call AGI like so:

exten => xxx,n,AGI(agi://localhost:5038/helloManager.agi)

Any suggestions at all are appreciated!!! thanks in advance.

Hi

I am having problem running asterisk-java sample code form

Hello Agi!

http://asterisk-java.org/1.0.0.M3/tutorial.html

i am following all steps everything goes well except that [color=#808080]NO file named “fastagi-mapping.properties” created but in tutorial it is mentioned that this file must be created [/color]by default and we have to map script

hello.agi=HelloAgiScript

[color=#BF00BF]I think .agi file is not created by default…how to check this[/color]
furthermore configuration i did on asterisk server are

Add a user in sip.conf
add this line extn => 888,1,Agi(agi://<1p of agi server>/HelloAgiScript in extntion.conf …under default context

is there need of any further configurations??..

Hi Ali,

I created “fastagi-mapping.properties”, but since the code is not working for me either, that may not be of much use to you.

Are you getting the same error I am?