Making media flow
Now that the SIP messages are flowing properly from FreeSWITCH to the phone, what about the media? A phone call is not very eventful if you can't even hear each other, right? We had many problems where the calls would set up properly until the point where NAT would strike the RTP packets that provide the actual audio of the call, rendering the call with one-way-audio or even no-way-audio in some cases. In light of this injustice, we created a separate feature that is always enabled and only needs to be manually disabled in a very few set of cases inspired by the fourth pitfall. This feature is called RTP auto-adjust. The reason we need it is because when the phone tries to call us from behind NAT, it will naively advertise its unreachable LAN address to FreeSWITCH as the intended destination for the audio.
We could guess that since the device is behind NAT, we should really send the audio to the same address that we saved from the SIP message. But that is not always the...