Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-22916

PJSIP NAT inconsistent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Support
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Asterisk SIP Settings
    • Labels:
      None
    • ToDo:
    • Asterisk Version:
      16.19.0
    • Distro Version:
      15.0.17.55 (12.7.8-2107-3.sng7)
    • Distro:
      FreePBX Distro

      Description

      Topology

      • Internal:
        • FPBX in DMZ VLAN (2)
        • Phones in Voice VLAN (3)
        • Routing: NGFW with SIP ALG disabled, NAT enabled
          • Internet traffic via WAN1 interface
          • SIP trunk traffic via WAN2 interface in point-to-point (private class A) subnet, with PSTN provider.
      • External
        • Provider server (peer): 10.20.40.5
        • Provider server (media): 10.20.50.5

      Config (assume settings that are not mentioned, are on defaults):

      • Admin
        • System Admin
          • Network Settings: 1 interface (eth0)
      •  Settings
        • Advanced Settings
          • SIP Channel Driver: chan_pjsip
        • Asterisk SIP Settings
          • General SIP Settings
            • External Address: 10.20.30.100 (Router WAN2 IP)
            • Local Networks: 192.168.0.0/16
      • Trunk:
        • PJSIP Settings
          • Authentication: None
          • SIP Server: 10.20.40.5

      pjsip.transport.conf:
      [0.0.0.0-udp]
      type=transport
      protocol=udp
      bind=0.0.0.0:5060
      external_media_address=10.20.30.100
      external_signaling_address=10.20.30.100
      allow_reload=no
      tos=cs3
      cos=3
      local_net=192.168.0.0/16

       

      Issue

      Although the external IP is set in SIP settings, FPBX spontaneously switches to sending the internal IP address of the server to the PSTN peer, in the Contact URI , instead of the set external address.
      This is true, even when the external address and/or internal address is/are set on Settings > Asterisk SIP Settings > SIP Settins [chan_pjsip] tab, and also true when the SIP Channel Driver is set to both and, NAT is set to Yes, Static and external IP specified/unspecified, on Settings > Asterisk SIP Settings > SIP Settings [chan_sip] tab. Testing in all these combinations leads to the same behaviour.

      Capturing packets both in FPBX and on the router's WAN2 interface (for the SIP trunk), reveals that at the Contact URI varies from sending the external IP for a span of hours to days, to sending the internal IP as though NAT is disabled, without any obvious cause/event. Trying to reapply Asterisk SIP settings is mostly ineffective, but occasionally, NAT translation returns to normal for no obvious reason.

      Rebooting FPBX yields unpredictable results, however, most times it continues to send internal IP.

      As yet, I have found no obvious pattern to isolate and have FPBX forcibly switch to external IP through a change in configuration, nor how to maintain the state.

       Discussion on the issue can be found here: Contact URI switching between internal and external IP - FreePBX / Configuration - FreePBX Community Forums

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fvh Henri
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.