I have FreePBX with ISP Flowroute working for a while.
These days we noticed that the Flowroute trying to call in from multiple IPs. The FreePBX only allow the registered SIP Server IP, and reject (401 Unauthorized) all incoming calls with other server IPs.
We set the server IP subnets(i.e. 34.210.91.112/28) in Match (Permit) of PJSIP advanced trunk definitions. FreePBX still rejects the incoming calls.
Yes, we are answering the incoming phone calls once it is accepted by FreePBX. We used tcpdump to identify the issue. The FreePBX only accept the IP that registered PJSIP trunk (SIP Server IP), and rejected all other IPs.
You need to include FlowRoute’s Signalling/Media CIDR in the “Match (Permit)” field of the Trunk configuration. This allows Asterisk to recognize all of their IPs (not just the first DNS match) and allows the calls through. You’ll find Flowroute’s CIDRs here, using the ones matching your Flowroute Region:
So, if your Flowroute Region is US-EAST-VA, you’d put 34.226.36.32/28 in the Match (Permit) field on the PBX’s Trunk config (Trunk edit > pjsip tab > Advanced sub-tab). This allows that entire subnet to reach your PBX, as Flowroute will use any of these to send you calls.