[asterisk-dev] Module to Asterisk function Compiler Issue question

Kevin P. Fleming kpfleming at digium.com
Tue Aug 2 06:30:29 CDT 2011


On 08/01/2011 09:20 PM, Mike Myhre wrote:
> I chose to use the verbose logging function to generate a message I can
> hook from my res module. Everything is working as expected, except when
> I try to run a shell script using the 'execlp' function. When I do that,
> the shell script runs, but asterisk promptly exits with no messages in
> the log or on the console.

It's doing exactly what the exec() family of functions is supposed to 
do; replace the current executable image in the process with a different 
one and then execute it. If you want to execute the shell script in a 
child process, you have to fork() first... but you'd be better off to 
use ast_safe_system() which handles quite a few other nasty details for 
you as well.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list