>Date: Thu, 24 Apr 2008 06:54:27 -0700 (PDT)<br>>From: Steve Edwards <<a href="http://asterisk.org">asterisk.org</a>@<a href="http://sedwards.com">sedwards.com</a>><br>>Subject: Re: [asterisk-users] Forking in Dialplan<br>
>To: Asterisk Users Mailing List - Non-Commercial Discussion<br> > <<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>><br>>Message-ID: <<a href="mailto:Pine.LNX.4.64.0804240648330.23487@fs.sedwards.com">Pine.LNX.4.64.0804240648330.23487@fs.sedwards.com</a>><br>
>Content-Type: text/plain; charset="x-unknown"<br><br>>> ----- "Tobias Ahlander" <<a href="mailto:plyschen@gmail.com">plyschen@gmail.com</a>> escreveu:<br><br>>>> Is it possible to somehow fork in the dialplan? Say a call comes in. <br>
>>> Then I want to wait 30 seconds and then write in a database, but at the <br>>>> same time while I wait I want to go on with other commands too.<br><br>>On Thu, 24 Apr 2008, Vin??cius Fontes wrote:<br>
<br>>> You can call an AGI script that will call another script. That last one <br>>> would wait 10 seconds and write in the database. The following example <br>>> works for me:<br>>><br>>> /var/lib/asterisk/agi-bin/agi-test.agi:<br>
>><br>>> #!/bin/bash<br>>> nohup /root/helloworld.sh 1>/dev/null 2>/dev/null &<br>>> exit 0<br>>><br>>> /root/helloworld.sh:<br>>><br>>> #!/bin/bash<br>>> sleep 10<br>
>> echo "Hello world!" >> /root/helloworld.txt<br>>> exit 0<br><br>>Why do you need the first AGI? Would:<br><br>> exten = _x.,n,system(nohup /root/helloworld.sh 1>/dev/null 2>&1 &)<br>
<br>>suit your needs?<br><br>>Thanks in advance,<br>>------------------------------------------------------------------------<br>>Steve Edwards <a href="mailto:sedwards@sedwards.com">sedwards@sedwards.com</a> Voice: +1-760-468-3867 PST<br>
>Newline Fax: +1-760-731-3000<br><br><br>Thank you Steve, this seems to work just as I want it to. Now I just have to figure out how to send variables to a system call, but I think I have that covered somewhere :) <br>
<br>Best regards, <br>Tobias<br>