Dialplan Applications

Hello everyone,
i am developing an application that shall allow users to access their mail boxes using their phones.
I developped an IVR menu of which users will make use to retrieve their mails. More specifically I write an AGI in perl to retrieve the mails. The issue is that the AGI execution takes quite a long time.To this end, I need to make my users hear some music played back in the background while the agi being executed. That is, i need to make the “AGI” and “MusicOnHold” applications in my dialplan execute simultaneously. Any clue how I can achieve this?

exten => s,1,SetMusicOnHold(your-background-music) exten => s,n,AGI(...) exten => s,n,NoOp(Turn off MOH for this channel) exten => s,n,SetMusicOnHold(none)

Also, if your AGI-script takes a long time to finish you might want to check out some tips in this book : “Asterisk Gateway Interface 1.4 and 1.6 Programming” by Nir Simionovich

Thank you for the reply but the SetMusicOnHold does not seem to work for me evethough I call the right class as defined in the musiconholf.conf file. I actually have another question: how can i make the agi script listen for DTFM digits entered by the user and hanup the call when the user enters zero?