[asterisk-users] Executing shell commands via AMI

Vinícius Fontes vinicius at canall.com.br
Wed Mar 16 13:14:40 CDT 2011


I'm trying to run a shell command from AMI, but I guess I'm doing something wrong or there's a bug because no matter what command I try I always get a null response. Running the latest 1.6.2 release. 





On manager.conf I have: 



[test] 
secret = test 
deny = 0.0.0.0/0.0.0.0 
permit=127.0.0.1 
read = command 
write = command 


And my session is as follows: 



pabx:~# telnet localhost 5038 
Trying 127.0.0.1... 
Connected to localhost. 
Escape character is '^]'. 
Asterisk Call Manager/1.1 
action: login 
username: test 
secret: test 


Response: Success 
Message: Authentication accepted 


action: command 
command: ! /bin/ls 


Response: Follows 
Privilege: Command 
--END COMMAND-- 


action: command 
command: ! /bin/ls -l / 


Response: Follows 
Privilege: Command 
--END COMMAND-- 


action: logoff 


Response: Goodbye 
Message: Thanks for all the fish. 


Connection closed by foreign host. 

Any ideas on how to make this work or should I file a bug report? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110316/c2e7a631/attachment.htm>


More information about the asterisk-users mailing list