[Asterisk-java-users] Help with the "!" CLI command via Manager CommandAction.
Brought to you by:
srt
From: Karien Du P. <kar...@gm...> - 2006-08-02 12:55:48
|
Hi. I'm trying to excute a normal shell command like "ls" via the Manager API using the CommandAction. If I type in "! ls" in the CLI command line on asterisk I get a directory print out. But when I do it via the Manager API using the CommandAction it doesn't seem to be executed. I have a ManagerResponseHandler in place we get a response back but it just says: 11180085_5# Follows It doesn't give us the directory list back. The code: CommandAction cmdAction = new CommandAction("! ls"); managerConnection.sendAction(cmdAction, this); The connection is correctly made and we can execute other cli commands like "help" and get the print out of the help result. The manager account that I'm using has the following privileges. read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user The reason why I want to this is to convert and delete recording files via a script that I wrote. Issuing commands like "! rm -f *.wav" doesn't delete the files so its not just a case of not retrieving the output back. Why is this the case? Can someone please help? I need this to work very fast - you know how it is with deadlines... I'm using Asterisk 0.2. Using the System application on a channel works fine. But I don't want to dial into asterisk (make a channel) everytime I do this to trigger the script. exten => 3333,1,System(conversion script) Thanks for any help. |