Robert DeVries
2007-Feb-05 22:27 UTC
[asterisk-users] Having Trouble With Wait Command in Callback Context
I am trying to get called back with a DISA dial tone when I call a trigger number. I got it to work almost the way I want, this is the callback context: [callback] exten=> 501,1,Congestion() exten=> 501,2,Hangup() exten =>h,1,System(cp /etc/asterisk/callback.info /var/spool/asterisk/outgoing) exten =>h,2,Hangup() With the above, the call comes into the trigger number, then the call file is copied and executed, I get the DISA dial tone, and can dial just fine. However, the problem is that the callback is a bit too fast, and sometimes calls back before I can hang up, even if I hang up fast. I want to program in a pause. However, when I do the following: exten=> 501,1,Congestion() exten=> 501,2,Hangup() exten =>h,1,wait (10) exten =>h,2,System(cp /etc/asterisk/callback.info /var/spool/asterisk/outgoing) exten =>h,3,Hangup() the callback never occurs, the execution never gets beyond the wait command. So, two questions - why does it not execute once I insert the wait command, and how do I get a wait before the call file is run. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070205/634a4bfc/attachment.htm
Pavel Jezek
2007-Feb-06 10:24 UTC
[asterisk-users] Having Trouble With Wait Command in Callback Context
I can confirm,
commands after Wait() are never executed in 'h' extension
and wait seconds argument in wait() is completely ignored
it's bug or "feature"? ;-)
h => {
NoOP(before ${EXTEN});
Wait(5);
NoOP(after ${EXTEN});
}
-- Executing [h@testservices:1] NoOp("IAX2/bill-gw-10",
"before h")
in new stack
-- Executing [h@testservices:2] Wait("IAX2/bill-gw-10",
"5") in new
stack
== Spawn extension (testservices, h, 2) exited non-zero on
'IAX2/bill-gw-10'
-- Hungup 'IAX2/bill-gw-10'
Robert DeVries wrote:> I am trying to get called back with a DISA dial tone when I call a
> trigger
> number. I got it to work almost the way I want, this is the callback
> context:
>
> [callback]
>
> exten=> 501,1,Congestion()
> exten=> 501,2,Hangup()
> exten =>h,1,System(cp /etc/asterisk/callback.info
> /var/spool/asterisk/outgoing)
> exten =>h,2,Hangup()
>
> With the above, the call comes into the trigger number, then the call
> file
> is copied and executed, I get the DISA dial tone, and can dial just fine.
>
> However, the problem is that the callback is a bit too fast, and
> sometimes
> calls back before I can hang up, even if I hang up fast. I want to
> program
> in a pause. However, when I do the following:
>
> exten=> 501,1,Congestion()
> exten=> 501,2,Hangup()
> exten =>h,1,wait (10)
> exten =>h,2,System(cp /etc/asterisk/callback.info
> /var/spool/asterisk/outgoing)
> exten =>h,3,Hangup()
>
> the callback never occurs, the execution never gets beyond the wait
> command.
>
> So, two questions - why does it not execute once I insert the wait
> command,
> and how do I get a wait before the call file is run.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
Wilson Pickett
2007-Feb-07 05:38 UTC
[asterisk-users] Having Trouble With Wait Command in Callback Context
> exten =>h,2,System(cp /etc/asterisk/callback.info > /var/spool/asterisk/outgoing)You could run a script instead of the cp command in system and add the wait in that.
Yuan LIU
2007-Feb-07 11:37 UTC
[asterisk-users] Having Trouble With Wait Command in CallbackContext
<html><div style='background-color:'><DIV class=RTE><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif">From: <I>"Robert DeVries" <A href="mailto:rdlists@gmail.com">rdlists@gmail.com</A></I></DIV> <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"> <DIV></DIV><BR>I am trying to get called back with a DISA dial tone when I call a trigger number. I got it to work almost the way I want, this is the callback context:<BR><BR>[callback]<BR><BR>exten=> 501,1,Congestion() <BR>exten=> 501,2,Hangup() <DIV></DIV><BR>exten =>h,1,System(cp /etc/asterisk/callback.info /var/spool/asterisk/outgoing)<BR>exten =>h,2,Hangup() <BR><BR>With the above, the call comes into the trigger number, then the call file is copied and executed, I get the DISA dial tone, and can dial just fine. <DIV></DIV><BR><BR>However, the problem is that the callback is a bit too fast, and sometimes calls back before I can hang up, even if I hang up fast. I want to program in a pause. However, when I do the following:<BR><BR>exten=> 501,1,Congestion() <DIV></DIV><BR> <DIV></DIV>exten=> 501,2,Hangup()<BR> <DIV></DIV>exten =>h,1,wait (10)<BR> <DIV></DIV>exten =>h,2,System(cp /etc/asterisk/callback.info /var/spool/asterisk/outgoing)<BR> <DIV></DIV> <P>exten =>h,3,Hangup() <BR><BR>the callback never occurs, the execution never gets beyond the wait command.<BR><BR>So, two questions - why does it not execute once I insert the wait command, and how do I get a wait before the call file is run. </P></BLOCKQUOTE> <P>People who know will answer the first question. But the second question has a ready answer: if you are using System(), why not insert a sleep right there?</P> <P>exten =>h,1,System(sleep 10; cp /etc/asterisk/callback.info /var/spool/asterisk/outgoing)<BR></P> <P>Hope this helps.</P> <P>Yuan Liu</P></FONT></div></html>
Robert DeVries
2007-Feb-07 17:20 UTC
[asterisk-users] Having Trouble With Wait Command in CallbackContext
I just tried what you suggested - it executes the sleep for 10 seconds, then skips down to the hangup, without copying the call file to begin the callback. However, I then broke the system command into two lines like this: exten =>h,1,System(sleep 10) exten =>h,2,System(cp /etc/asterisk/callback.info /var/spool/asterisk/outgoing) and it worked perfectly. Problem solved. Thanks. On 2/7/07, Yuan LIU <yliu11@hotmail.com> wrote:> > From: *"Robert DeVries" rdlists@gmail.com* > > > I am trying to get called back with a DISA dial tone when I call a trigger > number. I got it to work almost the way I want, this is the callback > context: > > [callback] > > exten=> 501,1,Congestion() > exten=> 501,2,Hangup() > > exten =>h,1,System(cp /etc/asterisk/callback.info > /var/spool/asterisk/outgoing) > exten =>h,2,Hangup() > > With the above, the call comes into the trigger number, then the call file > is copied and executed, I get the DISA dial tone, and can dial just fine. > > > However, the problem is that the callback is a bit too fast, and sometimes > calls back before I can hang up, even if I hang up fast. I want to program > in a pause. However, when I do the following: > > exten=> 501,1,Congestion() > > exten=> 501,2,Hangup() > exten =>h,1,wait (10) > exten =>h,2,System(cp /etc/asterisk/callback.info > /var/spool/asterisk/outgoing) > > exten =>h,3,Hangup() > > the callback never occurs, the execution never gets beyond the wait > command. > > So, two questions - why does it not execute once I insert the wait > command, and how do I get a wait before the call file is run. > > People who know will answer the first question. But the second question > has a ready answer: if you are using System(), why not insert a sleep right > there? > > exten =>h,1,System(sleep 10; cp /etc/asterisk/callback.info > /var/spool/asterisk/outgoing) > > Hope this helps. > > Yuan Liu > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070207/08cd55c9/attachment.htm