[asterisk-users] Forking in Dialplan

Craig Guy craig.a.guy at gmail.com
Fri Apr 25 11:19:07 CDT 2008


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



More information about the asterisk-users mailing list