How to wait for call pick up on outbound auto agi-script

How to wait for call pick up on outbound auto agi-script

AGI does not wait for call pickup when originating an outbound call bridged into an agi-script.


  1. asterisk -rx “originate local/18885551212 extension 1234@mycontext”
  2. Simple agi-script starts playing a message.
  3. By the time the outbound call is answered - the callee misses the beginning of the message.

How can I make the agi-script wait for pickup?

Originate does wait for AST_CONTROL_ANSWER. However, if you are using an analogue FXO line it can only detect answer if the line has a supported form of answer supervision and that is enabled in chan_dahdi.conf. I think polarity reversal is the only supported method.

If you don’t enable answer supervision, Asterisk has to assume that it is answered when dialing is complete. If you enable it, but the network operator doesn’t use it, the call will stall, in an ananswered state.

  1. Thanks for helping
  2. I am dialing out to Local/18885552525
    which in turn resolves to a VOIP call over a SIP provider.
    To the best of my understaning no analog FXO is involved.

Please help figure it out.

In that case, you need to take this up with your ITSP, as it looks like they are prematurely answering the call. You should start by using sip set debug on to get a trace of the call. Use the output to the log files (you may have to enable them) rather than a screen scrape, as only the former has proper timing information.

Thank you so much!
I think this is the source of the problem.
Is there any way I can send you a little thankyou like paypal/bitcoin etc?