Troubleshooting FreePBX and Asterisk SIP trunk is an important process to ensure your phone system functions optimally. Common issues include registration errors, audio problems, and NAT-related questions. By using the Asterisk CLI and reviewing logs, you can effectively diagnose and solve these issues.

Check Trunk Status in FreePBX Dashboard

  1. Step 1: Log in to FreePBX Dashboard

    Go to https://portal.internetport.com, navigate to Services and select My services. Find your SIP trunk and click on configuration details.

  2. Step 2: Check Trunk Status

    In the FreePBX Dashboard, go to Communication > Trunks. Select your SIP trunk and click on the Status tab to see if the trunk is registered.

Enable Asterisk CLI Debug asterisk -rvvvvv

  1. Step 1: Open Terminal or SSH to Server

    Connect to your FreePBX server via SSH.

  2. Step 2: Start Asterisk CLI with Debug

    Run the command asterisk -rvvvvv to start CLI with maximum debug level. This provides detailed information about SIP communication.

Registration Fails with 401, 403, 408 Errors

  1. Step 1: Check Credentials

    For 401 (Unauthorized) and 403 (Forbidden) errors, verify that SIP username and password are correct. Find these in Communication > Trunks under your trunk.

  2. Step 2: Check Server Availability

    For 408 (Request Timeout) errors, check that the SIP server sip.internetport.se is up and reachable from your server.

No Audio or One-Way Audio RTP NAT

  1. Step 1: Check RTP Ports

    Go to Communication > SIP Settings, ensure that the RTP port range is correctly configured.

  2. Step 2: Configure NAT in pjsip.conf

    In pjsip.conf, add or update settings for local_net and externip. Example:

    [transport-udp]
    type=transport
    protocol=udp
    bind=0.0.0.0
    local_net=192.168.1.0/24
    external_media_address=your.external.ip.address

Codec Mismatch Check Allowed Codecs

  1. Step 1: Check Allowed Codecs in FreePBX

    In Communication > Trunks, under your trunk, ensure that the supported codecs by Internetport (G.711 a-law, G.711 u-law, G.722, G.729) are marked.

  2. Step 2: Check Codec Settings in pjsip.conf

    Check that codecs match in pjsip.conf. Example:

    [endpoint-name]
    type=endpoint
    context=default
    disallow=all
    allow=ulaw
    allow=alaw
    allow=g722
    allow=g729

NAT localnet and externip in pjsip.conf

  1. Step 1: Identify Your Local Network

    Use ifconfig or equivalent to find your internal IP address and subnet mask.

  2. Step 2: Update pjsip.conf with NAT Settings

    Add or update local_net and external_media_address in your transport settings. See example above.

Gather Diagnostics and Contact Support

  • Check logs in FreePBX under Status > Logs.
  • Use the command sip show peers in Asterisk CLI to display SIP peer status.
  • Upload relevant logs and configuration files to Internetport support page.

For further assistance, visit support page on Internetport.