On Wednesday 13 Apr 2011, Thorsten Göllner wrote:
> It should work - I think. BUT I am not really sure what will happen, if
> the child process exits. The child works with a copy of all asterisk
> ressources given to it, when forking. So when the child dies, perhaps
> asterisk will do a hangup or continues in the dialplan for this process.
> I think, that could cause some unwanted results.

The parent exits immediately after the fork.  The child begins by closing 
STDIN, STDOUT and STDERR; so once those handles are dropped, it ought to be 
completely separate from Asterisk.

> You should try to write a daemon process which handles the database
> lookups or whataver while being totally independent of the atserisk
> process.

I hadn't actually thought of doing it that way, but it makes sense.  Still, 
the forking method seemed to work  (i.e., the dialplan continues straight 
away)  when I tested it with just a sleep in the child process  (once I 
remembered to close STDIN, STDOUT and STDERR!)  and I could not get a zombie 
when I thoroughly tested forking on my own desktop, so I'll give it a go and 
see what happens .....


-- 
AJS

Answers come *after* questions.

--
_____________________________________________________________________
-- 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

Reply via email to