3CX App Provisioning template Internal IP Change needed - Post-IP change outbound call bug

Status
Not open for further replies.

aragone

SMB User
Joined
Nov 2, 2022
Messages
14
Reaction score
2
I've been chasing down an elusive "bug" - I know what it is and have a workaround, but don't know what 3CX config needs to change to fix it.

TLDR: we changed IPs from an internal RFC1918 to a direct Public IP. The 3CX Phone provisioning file is still pushing the private Internal IP, but that no longer exists on the system. It causes outbound calls to fail with error `Unidentified Incoming Call. Review INVITE and adjust source identification: INVITE ...` (basically the client is being misidentified on the IP address).

It seems the "new IP" wasn't fully pushed throughout the PBX's config / database and the old one lingers.

Things Checked
  • Settings > Network > Select network card interface > Choose which IP is the Default Internet facing IP address (Default gateway)
    • Only provides one IP, the new correct one
    • This is selected properly
  • Looked for provisioning files and/or templates
    • Searched:
      • /var/lib/3cxpbx/Instance1/Data/Http/Interface/provisioning
      • /etc/nginx config files and Location paths
      • find / for provisioning files, templates
      • grep -R / for RFC_1918_ADDR
    • Nothing meaningful found

The workaround
  • Download the 3CX provisioning file (curl the URL in the extension QR code)
  • sed -i 's/RFC_1918_ADDR/PUBLIC_IP_ADDR/g' provisioning_file
    • This ultimately changes 3 XML fields (example below)
  • Generate a new QR with a self-hosted provisioning file with the modified IP
  • Scan the new QR code in the 3CX App
  • Make a call - voila! It works!
Code:
<tconfig>
...
<PBXLocalAddr>PUBLIC_IP_ADDR</PBXLocalAddr>
<ProvLink>https://PUBLIC_IP_ADDR/provisioning/PROVISIONING_PATH.xml</ProvLink>
<MyPhoneServerLocalSSLAddr>https://PUBLIC_IP_ADDR/myphone/MPWebService.asmx</MyPhoneServerLocalSSLAddr>
...
</tconfig>

Workaround Problem
The 3CX app will provision properly and is able to make outbound calls when loading the modified provisioning file. However, after a timeout it seems to be refreshing in the background directly to the 3cx PBX and fetching the old bad internal RFC_1918_ADDR values, causing outbound calls to fail with the SIP error mentioned earlier (inbound is fine).

It would be a lot of work to maintain and redirect provisioning files and modifying the URLs, which probably can be done, but ultimately the Workaround was a proof-of-concept of the issue and a fix.

Questions

How can this Internal IP be force updated in 3CX? Some ideas:
  1. What parameters (Settings > Advanced > Parameters) can be changed to force an Internal IP override?
    1. SIPINTERFACEIP doesn't seem quite right, but is the closest I found to what I think I need here
  2. Are there any files (e.g. 3cx phone provisioning templates, configuration files) that can be modified to specify the external IP?
    1. A `grep -R INTERNAL_IP_ADDR /` doesn't result in anything meaningful, which makes me think this is a DB variable somewhere
  3. Would creating a new Public IP on the box and "toggling" between them on Settings > Network > NIC IP do anything?
    1. I've got plenty of IPs at my disposal, so not an issue
  4. Where is the 3cx provisioning template created?
    1. Reviewing `/var/lib/3cxpbx/Instance1/Data/Http/Interface/provisioning` and `/etc/nginx` config files does not provide any meaningful files
  5. Other thoughts?
 
I tried adding a second public IP, toggling between them, and restarting for each change, but the provisioning files still all use the RFC1918 addr.
 
Please refer to this guideline as only properly configured RFC1918 are supported:

1714620229073.png
 
@TheodorosG_3CX that doc is irrelevant - we had a working setup on RFC1918 space, but now have a direct Public IP on the box.

The issue is the PBX still "thinks" RFC1918 exists for the provisioning XML config pushed to 3cx apps.
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,832
Messages
589,278
Members
164,662
Latest member
DejanMDS