Call progress

Hi all,
I would like to dial a number and check out if it is busy or no answer or IVR and only when it gets connected i would like to connect it to another phone. How could this be done using Asterisk Manager API’s or AGI’s or any other way possible?

Thanks
rani

Search call file on Asterisk Wiki voip-info.org.

Check for ChanAvail function in voip info of asterisk pbx