Carlos Chavez
2010-Aug-19 21:56 UTC
[asterisk-users] Executing system commands through Manager API
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? -- Telecomunicaciones Abiertas de M?xico S.A. de C.V. Carlos Ch?vez Prats Director de Tecnolog?a +52-55-91169161 ext 2001 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20100819/f4f8d200/attachment.pgp
Steve Edwards
2010-Aug-19 22:56 UTC
[asterisk-users] Executing system commands through Manager API
On Thu, 19 Aug 2010, 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?1) Change the user for Asterisk. 2) man sudo -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Sherwood McGowan
2010-Aug-20 03:10 UTC
[asterisk-users] Executing system commands through Manager API
On Thu, Aug 19, 2010 at 5:56 PM, Steve Edwards <asterisk.org at sedwards.com> wrote:> On Thu, 19 Aug 2010, 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? > > 1) Change the user for Asterisk. > > 2) man sudo > > -- > Thanks in advance, > ------------------------------------------------------------------------- > Steve Edwards ? ? ? sedwards at sedwards.com ? ? ?Voice: +1-760-468-3867 PST > Newline ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Fax: +1-760-731-3000 > > -- > _____________________________________________________________________ > -- 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 >Another possibility would be to use the IMAP or ODBC storage option for Voicemail? Just a thought :)
Ishfaq Malik
2010-Aug-20 08:20 UTC
[asterisk-users] Executing system commands through Manager API
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-usersHi 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