[Asterisk-bsd] RTP destination address with NAT

Mike Durian durian at shadetreesoftware.com
Wed May 28 21:49:00 CDT 2008


I recently updated asterisk from the FrssBSD ports collection to
1.4.19.2.  I've been trying to track down some strange routing
interaction with the RTP packets from my asterisk server, which is
not behind a NAT, to my phone, which is behind a NAT.  I also have
a bunch of funky pf routing rules to route the phone traffic over
a cable line or a DSL line depending on some conditions.  My routing
rules used to work, but now they fail after the update.  I think
the problem might be related to the IP address used by asterisk
when sending RTP packets to my phone.

Despite having nat=yes enabled for my phone peer, asterisk is using
it's unroutable address (192.168.1.10) for the first few packets
it sends to the phone.  I verified this by turning on rtp debug.
Only after asterisk receives an RTP packet from the phone, does it
switch to using the NAT address.  I won't get into the messy details
(partly because I don't fully understand all the interactions), but
I believe the first few RTP packets to the 192.168 address are
causing routing problems for me.

All that said, my question is rather simple.  How do I keep
asterisk from sending out any RTP packets until it receives one?
If I can prevent asterisk from sending RTP packets until it learns
the NAT address by receiving one, I think I can solve my problems.

Thanks,
mike




More information about the Asterisk-BSD mailing list