[Asterisk-Users] Reload Asterisk from php or perl script

Richard Lyman pchammer at dynx.net
Fri Oct 8 07:41:14 MST 2004


Dee Lowndes wrote:

>>-----Original Message-----
>>From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-
>>bounces at lists.digium.com] On Behalf Of Justin B. Newman
>>Sent: 08 October 2004 14:54
>>To: Asterisk Users Mailing List - Non-Commercial Discussion
>>Subject: Re: [Asterisk-Users] Reload Asterisk from php or perl script
>>
>>
>>On 10/8/2004, "Dee Lowndes" <dee at asyouneed.com> wrote:
>>    
>>
>>>Hi,
>>>
>>>	I am looking for a basic script that can reload asterisk from
>>>php or perl via a web browser.
>>>
>>>I have tried exec( asterisk -rx reload ) and shell_exec( <same cmd> )
>>>with php but there seems to be a permission issue with asterisk that
>>>stops these working. I was just wondering if anyone has a way around
>>>this with perl or php.
>>>
>>>      
>>>
>>Dee,
>>
>>If Asterisk is running as a different user than your web server, then
>>you're
>>not going to be able to use those scripts "outta the box".  Running
>>Asterisk
>>as the same user as your web server would probably be considered a
>>horribly
>>insecure configuration, at best.
>>
>>The alternative is to explore options for allowing your webserver to
>>    
>>
>run
>  
>
>>programs as different userid's.  If you're running Apache, this page
>>    
>>
>may
>  
>
>>help:
>>   http://httpd.apache.org/docs/suexec.html
>>
>>Good luck!
>>    
>>
>
>I am using apache but I would rather avoid this option if possible.
>
>Any other ideas?
>
>Dee
>
>  
>
why not just use the manager interface
 
telnet localhost 5038<CR>
action: login<C>
username: yourusername<CR>
secret: yoursecret<CR>
<CR>
action: command<CR>
command: reload<CR>
<CR>
action: logoff<CR>
<CR>





More information about the asterisk-users mailing list