Re: [Asterisk-java-users] Help with the "!" CLI command via Manager CommandAction.
Brought to you by:
srt
From: Karien Du P. <kar...@gm...> - 2006-08-03 10:42:50
|
On 8/3/06, Stefan Reuter <sr...@re...> wrote: > > Karien Du Preez wrote: > > 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. > [...] > > Why is this the case? > > I think this is due to the fact that ! simply escapes to the shell you > used to connect to the asterisk server. So if you are connected through > the Manager API there is no shell to escape to. > > > Can someone please help? > > Probably the simplest way is not using the Manager API to run unix > commands on Asterisk but stick to ssh. Maybe something like JSch > (http://www.jcraft.com/jsch/) =Stefan Thanks for the advice, works like a charm. Just a quick question, I know its meant for the asterisk-users list, but that list has way too much traffic on it and you hardly get a decent reply. How can you check in your dialplan that a channel varaible has been set/not empty/not zero? I tried expressions like $[${var} != ""] $[${var} > 0] but it doesn't seem to work. Thanks. |