[asterisk-dev] Re: IAX native bridge and NAT

Tim Davies tim at opensystems.net.au
Mon Jun 19 01:51:48 MST 2006


I've u-turned on this enough times already, so once more won't hurt.

Here's a much, much simpler solution... On receiving a TXCNT, just set
the transfer address to where the TXCNT was received from (and then send
the TXACC).  That's it!  Okay, not quite...

On normal IAX packets (not TXCNT/TXACC), we will only accept packets
from the address that outgoing packets are transmitted to (for the
current call).   This is how UDP addressing should work.

Expanding this basic idea:

- We must ignore TXACCs from any address that isn't our transfer address
(this is true even before my changes).  Otherwise once the call is
transferred, the packets would be ignored anyway. 
- The retransmissions of our TXCNTs will go to the "new" transfer
address.  Which is good - we do want to get the TXACC reply, and that
address is the best one to try.
- We mustn't change the transfer address if we have already become
TRANSFER_READY.  Besides, if the TXCNT<->TXACC worked one way, it's a
safe bet it will work the other way.  In fact, if the TXCNT source
address differs from our transfer address at this stage, we shouldn't
even reply.

So it's erring on the safe side.  If TXCNTs or TXACCs are out-of-order,
or there is a weird source address problem, the transfer will reject. 
But it does give it a good chance of succeeding if the addresses given
by the TXREQ are not correct from the peers' point of view.  And it is
backwards compatible.


Tim.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: transfer.diff
Type: text/x-patch
Size: 1715 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20060619/047137a3/transfer.bin


More information about the asterisk-dev mailing list