This is my approach attempting to solve the problem of a call passing twice over an IAX link.
Linking two Asterisk via IAX allows to transfer calls between users on a different PBX, this is what happens:
ext_call ------> pbx_a -----IAX link-----> pbx_b ----> user@b
If user@b need to transfer the call back
to an user on pbx_a, this is what happens:
ext_call ------> pbx_a -----IAX link-----> pbx_b
user@a <-------- pbx_a <----IAX link------ pbx_b
The call traverses twice
the IAX link loosing quality, with lag and wasting bandwith for other calls.
My solution is based on ChannelRedirect
and Asterisk func iaxvar.
Asterisk func iaxvarAsterisk cmd ChannelRedirect