Agi music on hold

hi all…
i would like to know if there is a way to start and interrupt playback/background/music on hold from an agi script.

like… the control is passed from the dial plan to the script. the script starts playing some music while it goes to find some stuff elsewhere. usually the search lasts 30 - 45 seconds. so i’d like to start a playback at the beginning of the script and the moment it gets back the search result to cut off the playback and write another command back to the dial plan.

what would be the most practical way to do that?

thanks…

any ideas? i need to figure this out pretty soon…

thanks a lot to all that replied… it has been fun.