Is this Asterisk issue of feature

Home » Asterisk Users » Is this Asterisk issue of feature
Asterisk Users 3 Comments

Hi List,

I am confuse about this feature.
When we use Wait(20) in active call session then it’s work. But when we use
after hangup the call then Asterisk don’t wait from define time.



exten => 4368,1,Answer()
exten => 4368,n,Flite(“Welcome”)
exten => 4368,n,Set(__StartTime=${STRFTIME(${EPOCH},Asia/Calcutta,%Y-%m-%d
exten => 4368,n,Set(__uniqueId=${UNIQUEID})
*exten => 4368,n,Wait(20)* *; At this moment it’s work.*
exten => 4368,n,Hangup()

exten => h,1,NoOp(*******************Now wait(20) wouldn’t work
***************** )
exten => h,n,Wait(20) * ; At this moment it’s not work.*
exten => h,n,NoOp(*******************never come into execution

3 thoughts on - Is this Asterisk issue of feature

  • Wait is not ONLY for use with Answer, that just happens to be a common use.

    To answer the OP, a quick look at confirmed that Wait does not work after a channel is hung up:
    “If Wait() is run on a channel which has been hung up (i.e. from the ‘h’ extension), the Wait() application returns 0 immediately and no further processing of the ‘h’ extension priorities takes place. You can get around this with ‘System(path/to/sleep Xs)’, where ‘X’ is the number of seconds to wait. Nasty, but it works. ”

    Sent from my iPhone

  • Hi ,

    Thanks for reply ..
    What is the meaning of that line which you have mention on the recent

    System(path/to/sleep Xs)

    path/to/sleep => is the paths of any php script where sleep function is
    mention or anything else ?
    please illustrate if it is possible ….

    On Thu, May 26, 2011 at 4:43 PM, Sherwood McGowan <> wrote:

  • Hi List,

    Yes as per your suggestion I make a bash script for sleep the server. But
    doing so asterisk session also stop and server can’t do any job in such

    Actually I am using Asterisk and a2billing for my calling card system. When
    We hangup our call then a2billing start billing script which is my priority
    to do some changes into the call information after 2 sec. of wait for which
    I need to sleep the service at certain time. But if I start bash script for
    sleep then all thread of server also stop and I will on the same stage as

    Do you have any other idea ? I already used php sleep(2) function..

    and I can’t do any work in between this sleep time into server.

    On Thu, May 26, 2011 at 7:00 PM, A J Stiles