How Exactly Does Asterisk Know What IP To Send RTP Traffic To?

Home » Asterisk Users » How Exactly Does Asterisk Know What IP To Send RTP Traffic To?
Asterisk Users 1 Comment

Hello,

I have a somewhat confusing use case. We use a mobile voip app and our users connect to our PBX via a public IP of our firewall which port forwards to asterisk (TLS and SRTP ports). Works fine.

Sometimes however, our users are also connected to our VPN (LT2P/Ipsec) which is served by the same firewall that our PBX sits behind at the datacenter.

In this case, most often the calls go through but there is no audio.

I believe that asterisk “thinks” in this case that the IP of the clients, to send RTP traffic to ,t is the firewall’s IP, rather than the IP that the VPN server assigned the client device. Does asterisk send RTP traffic to the IP which is in the IP headers of the SIP REGISTER , or can a client “specify” it’s truly reachable IP ?

I hope this makes sense. Regards,

Kevin Long

One thought on - How Exactly Does Asterisk Know What IP To Send RTP Traffic To?

  • HI Kevin

    Is your VPN set as a localnet? The externip only tends to cope with the firewall address. If you put the VPNs in the localnet lists then it won’t use NAT to find them.

    In answer to your question, the SIP session description in the call setup has the IP for media for both parties, which is where Asterisk /
    client will send RTP to respectively . You can look at this using tcpdump. c= is what you are looking for.

    Some formal examples

    https://tools.ietf.org/html/rfc4317

    Cheers Duncan