Caller ID Block

I’m using a an Asterisk box and an AudioCodes FXO gateway connected to analog lines from Bell Canada.
Bell Canada allows you to hide your caller ID by dialing *67, waiting for a second dial tone and then dialing the number you wish to call .
I want the user to dial *67 followed by the number in on shot and then have asterisk dial *67 through the gateway and then send the phone number as DTMFs after the second dial tone.

If I implement it as a Dial followed by a SendDTMF in the dialplan, the DTMFs are not sent because the call is not connected at the time the second dial tone is presented to the gateway so Asterisk is still waiting to proceed.

If I send the full dial string to the gateway at one shot, it will fail because there is no delay between dialing *67 and the number.

Any idea how I can do this dial in two stages?
Can I get asterisk to send the DTMFs before the call is connected?

What is you use the Wait() application between the Dial() and SendDTMF()? You just need to set a wait time that is long as the Asterisk takes to establish the outgoing call.

Anything after the Dial will not be run until the call completes or fails.

You can put pauses in the dial string using codes similar to AT modem codes.

Using a PABX on a domestic FXO line, and then trying to use domestic line type calling features, is something of a hack.