Linking two channels and then dropping out

Here is the situation. I’m having someone call into my automated system. And at some point I want to transfer them to an outside number. I currently do a channel.exec(Dial, SIP/Provider/externalNumber|timeout|r) this works fine. However, the next step that I want to do is once these two channels are linked, I want to be able to walk away from the connection. is this possible? or should I change the way that I am transferring the caller out?

Thanks ahead.