Execute agi and play sound at the same time


I have dialplan that makes a call to php script to lookup data and return info to caller. I would like to play audio while this php executes.

In other words, I need to call that php file and start audio at the same time, then end audio when the result is returned.

I am having trouble understanding how this can be done. Any ideas


I made this using Local Channels and Redirect command, I sent the caller to MusiconHold context while lookup the data on the Other Context, once the data it is ready redirect the caller to a context who playback the data to the caller