Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Forking in Dialplan


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
plyschen at gmail.com
Guest





PostPosted: Thu Apr 24, 2008 3:51 am    Post subject: [asterisk-users] Forking in Dialplan Reply with quote

Hello,

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.
Thanks,
Best regards,
Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080424/fc2a0684/attachment.htm
Back to top
moshe at ipconnect.co.il
Guest





PostPosted: Thu Apr 24, 2008 5:28 am    Post subject: [asterisk-users] Forking in Dialplan Reply with quote

what kind of command do you want it to do in the background? The obvious
answer your question would probably be to use an agi script.

On Thu, Apr 24, 2008 at 11:51 AM, Tobias Ahlander <plyschen at gmail.com>
wrote:

Quote:
Hello,

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.


Thanks,
Best regards,
Tobias

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--
Moshe Brevda, CTO
ipconnect, ltd.
26 Strauss St., Jerusalem, Israel
W. 1.800.800.456 (+9722.569.5295)
M. +97254.666.1367
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080424/9d2df29a/attachment.htm
Back to top
vinicius at canall.com.br
Guest





PostPosted: Thu Apr 24, 2008 8:17 am    Post subject: [asterisk-users] Forking in Dialplan Reply with quote

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




Att
Vin?cius Fontes
Desenvolvimento
Canall Tecnologia em Comunica??es Ltda.

----- "Tobias Ahlander" <plyschen at gmail.com> escreveu:

Quote:
Hello,

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.


Thanks,
Best regards,
Tobias

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
tilghman at mail.jeffa...
Guest





PostPosted: Thu Apr 24, 2008 9:20 am    Post subject: [asterisk-users] Forking in Dialplan Reply with quote

On Thursday 24 April 2008 03:51, Tobias Ahlander wrote:
Quote:
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.

There isn't a fork, but there is a method built in that is rather similar to
the alarm(2) interface in the kernel, which is called Absolute Timeout. The
method of using this is Set(TIMEOUT(absolute)=30), which sets a timer that
will fire in 30 seconds. When that timer fires, any application that is
currently executing will terminate, and you will be redirected to the "T"
extension in the current context. Note that you can also cancel this timer
by using setting the timeout to 0, i.e. Set(TIMEOUT(absolute)=0).

Also note that there can only be a single absolute timeout per channel (i.e.
setting a new timeout resets any timer currently in effect).

--
Tilghman
Back to top
plyschen at gmail.com
Guest





PostPosted: Fri Apr 25, 2008 5:07 am    Post subject: [asterisk-users] Forking in Dialplan Reply with quote

Quote:
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"

Quote:
Quote:
----- "Tobias Ahlander" <plyschen at gmail.com> escreveu:

Quote:
Quote:
Quote:
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.

Quote:
On Thu, 24 Apr 2008, Vin??cius Fontes wrote:

Quote:
Quote:
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

Quote:
Why do you need the first AGI? Would:

Quote:
exten = _x.,n,system(nohup /root/helloworld.sh 1>/dev/null 2>&1 &)

Quote:
suit your needs?

Quote:
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 Smile

Best regards,
Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080425/8b4657a8/attachment.htm
Back to top
craig.a.guy at gmail.com
Guest





PostPosted: Fri Apr 25, 2008 11:19 am    Post subject: [asterisk-users] Forking in Dialplan Reply with quote

On 4/25/08, Tobias Ahlander <plyschen at gmail.com> wrote:
Quote:
Quote:
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"

Quote:
Quote:
----- "Tobias Ahlander" <plyschen at gmail.com> escreveu:

Quote:
Quote:
Quote:
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.

Quote:
On Thu, 24 Apr 2008, Vin??cius Fontes wrote:

Quote:
Quote:
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

Quote:
Why do you need the first AGI? Would:

Quote:
exten = _x.,n,system(nohup /root/helloworld.sh 1>/dev/null 2>&1 &)

Quote:
suit your needs?

Quote:
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 Smile

Best regards,
Tobias
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services