# Manager API - Java - timeout on executing a CLI command

**URL:** <https://community.asterisk.org/t/manager-api-java-timeout-on-executing-a-cli-command/41871>\
**Category:** Asterisk General\
**Created:** [February 13, 2013, 12:05pm UTC](https://community.asterisk.org/t/manager-api-java-timeout-on-executing-a-cli-command/41871 "2013-02-13T12:05:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alped88](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@alped88](https://community.asterisk.org/u/alped88)\
**Post date:** [February 13, 2013, 12:05pm UTC](https://community.asterisk.org/t/manager-api-java-timeout-on-executing-a-cli-command/41871/1 "2013-02-13T12:05:12Z")

</div>

Hi,  
I’m Using  
=\> Asterik 1.8  
=\> asterisk-java-0.1.jar

Can anybody give me an example java manager class to execute a CLI command.  
Say, “queue show” and how do I capture it.

# my code:

managerConnection.login();  
System.out.println("\*\*\*\*\*\*\*\*\*\*\*\*\*\* after login");

# CommandAction commandAction = new CommandAction(); commandAction.setCommand(“queue show”); commandAction.setActionId(“MY\_COMMAND”); CommandResponse response = (CommandResponse) managerConnection.sendAction(commandAction, 10000);

Logs in fine, but when ‘sendAction’ is executed, the action request gets timed-out…

Pls pls help…
