As you can see in the source of dialplan function SHELL (funcs/func_shell.c), it just uses popen(3). Thanks for the info. I ended up using the dup2 method as recommended by Tzafrir Cohen, but the popen will be handy in other needs. Thanks