Short answer… Use SIP. It allows for the RTP stream to be rerouted. I ran across this while researching something similar…
Quote from Link Above:
"SIP vs IAX
by cdyne on Thursday 08 of June, 2006 [17:34:55]
Well one MAJOR point Mark did not touch on.
Audio always goes through the IAX server. With SIP, the RTP stream can redirect on a transfer.
You have a calling card application. Someone calls your PBX and enters the code. You then transfer them to the number they entered. SIP keeps accounting the call, but the audio stream is sent from provider to provider (So, you don’t have to deal with the audio bandwidth).
You must set up Reinvites in my experience to get this to work. But, it saves us a ton of bandwidth.
If you are using a provider that supports sip, but uses a major telco backbone with good network pipes, this could improve your sound quality depending on how your provider coded it. Using IAX with voipjet for instance, the call has to go to New Jersey… then off to Washington and then who knows where else. Voxee is the same way.
Anyone, correct me if I am wrong here. But, I have this setup working for me."