OriginateAction Login and Logoff

I am working with a Java Application working with Asterisk. According to the tutorial from Java-Asterisk API
like this

[code] 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();[/code]

After OriginateAction process, it is done a logoff from managerConnection. I am wondering if it is a must procedure to do this logoff, if I did not logoff, are there some problems.

thanks

There shouldn’t be problems, but that case probably isn’t as well tested as doing things properly.

I am thinking how the ManagerConnection works, for example, if there are thousands of end users initiate OriginateAction from my java application. Does Asterisk could handle thousands of ManagerConnection login without any log off after OriginateAction is done.

Thanks

Resources are tied up in relation to the TCP connections. If you don’t close the TCP connection, you will cause problems. I’m not actually sure if Logout closes the connection, but exiting the program should.