Play Sound files on demand

I have a working asterisk freepbn server running several conference call rooms. I would like to be able to play specific audio files from the server over the conference when selected from a simple interface (I’m thinking HTML) but have no idea where to start. The rough plan is that in time critical conferences the leader could select audio files that remind people how long is left "15mins remaining ". Later I play to script the playback but for now I am wondering if this is possible.

Thanks for any help,


Inyect the audio to the conf using the chanspy.

Thanks. I have looked at chanspy and it might work,but what is the easy way to Inject the audio?

I was thinking I could use music on hold and hold the call for the length of the audio file. Is there a way to command music on hold to play a specific file and not just the one from the dial plan?

Yes make your own music class on the musiconhold.conf … nhold.conf … usicOnHold

Thanks for this - I think MoH maybe the way forward for my solution but can i force a conference into HOLD for all users for the duration of the music clip?

If that isnt possible how can I inject music via chanspy?

I made a dial plan for play a background music during a call using chanspy … it is called directly from the dial plan. In your case you want to inject the music through a web app, so I think you must use AMI

I was just looking at AMI - could you give an example of your dialplan using chanspy please?

I am assuming there is no way for admin to force all conference users on hold (therefore invoking MoH?).

If you dial 1923 it will inject background music on the calls bridged to extension 100
exten =>_1923,1,Dial(Local/1924@spy-exten,30,G(internal^0^1))


Thanks for the dial plan (i am having some problems getting it working with my Asterisk/FreePBN setup as currently Im at the Web interface level of editing - when I added your dialplan to my extensions.conf then my confbridge extensions stopped working - I will look at this later)

If i used AMI is there a way I can just call chanspy to play a music file to the extension in question?

I have tried ChanSpy from the AMI interface but keep getting command not recognised.

I guess the other option could be to start a call from AMI and redirect the audio that way with chanspy?