Call out then redirect to an outbound number; possible?

This is what I wanna do, call a phone number and if answered, would redirect to an outbound number. I’m using IAX2; the problem is after the call out is setup, it always dials the second outbound number. I wanna this to happen only in case the first outgoing call was answered. Any ideas?