[asterisk-users] Executing system commands through Manager API

Ishfaq Malik ish at pack-net.co.uk
Fri Aug 20 03:20:00 CDT 2010

On Thu, 2010-08-19 at 16:56 -0500, Carlos Chavez wrote:
> 	I am making a web interface so users can manage their voicemail.  The
> only problem I have is that since the Web server and Asterisk run as
> different users I need to run some commands through Asterisk so I can
> manipulate the voicemail files.
> 	I know that from the CLI I can user the "!" commando to run any
> external shell command but when I try to do it from the Manager API
> using "Command" I cannot get it to work.  Since the web server cannot
> erase or modify files I need to go through Asterisk to execute rm or mv.
> 	Is there an easier way to do this (without changing the user for
> Apache)?  Is it possible to use the ! command from the Manager?
> -- 
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users


We had a similar, though not exactly the same issue and got round it by
putting the apache user into the asterisk group and made all the folders
and files in /var/spool/asterisk/voicemail group writeable. I think
you'd need to change the umask on it too.

This way the apache user can delete the files. However, please not that
there is a trade off between security and convenience here although it
isn't horrendously insecure. 

Ishfaq Malik
Software Developer
PackNet Ltd

Office:   0161 660 3062

More information about the asterisk-users mailing list