On Friday 30 Jun 2017, Jonathan H wrote: > What's the simplest, easiest quickest least-code way of firing off an AGI > with some variable, and then returning to the dialplan?
You have to use the "fork" command. This starts a copy of the process with all the same internal state including variables and filehandles. The command returns a non-zero value (which is the PID of the child process; you may need this, if you plan to outlive your children and have to clear their entries from the process table) to the parent process, and zero to the child process. So in the parent, you exit and return to the dialplan; and in the child, you close STDIN, STDOUT and STDERR (so no process is waiting for you to produce output), then just take your time doing what you have to. The parent is already long dead by this time, so exiting goes nowhere. > I've seen people talking about fastAGI, stasis, python ASYNC... all seems > rather complicated. I feel I must be missing something embarrassingly > obvious - isn't there just the equivalent of the unix shell's "&"?! Yes, fork! That is what the "&" operator is using "under the bonnet". -- JKLM Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk . -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
