Playing a music file before call connects using Asterisk


I have an asterisk server. I use the server to connect an incoming call to another extension based on a few key presses. There is a certain time lag (after the key/extension press and before the call connects). How can I play a small music file (of my choice) in this period? There are some constraints that come to my mind:

  1. The music should play only as long as the call does not connect. So, the method used should be a non-locking one.

Any help on this is most welcome.


“m” on dial. NB this requires that the upstream network supports call progress before answer. In general for commercial reasons, the PSTN does not, because answer signals the start of charging.

All this is in answers posted to the forum yesterday.

Of course, you can connect the incoming call and then play music without, but the caller will get charged on the PSTN.


I did a little research and came up with the following:

What about using Playback/Background?

Basically like so:

Playback, to me, would be better because the control would not be returned until the file finished playing.

I know I have written in the first post that I am looking for methods that wont lock up the resources, but I was wondering what would happen if the asterisk server connected the call while the music file was still playing for the caller?


Playback will be stopped by the Dial application.

You need an additional parameter on playback if you want to send in band progress. Playback will normally answer the incoming call.