I’m having some trouble getting my setup to work correctly.
I use a SPA3102 as a gateway device to the PSTN on the FXO port. I also have an old analog phone connected to the FXS port on the SPA3102. The SPA3102 creates two registrations on the SIP server, one for the FXS port (using a local srouce port of 5060) linking to a standard extension, and a second one for the FXO Port (using a local source port of 5061), which matches the trunk definition.
Then there are a number of sip extensions which are phones distributed around the house.
This setup works on my old FreePBX 11.x distro, so we can assume that the SPA3102 and the sip phones are setup correctly.
Then, I installed a fresh FreePBX13 and decided to switch my setup to PJSIP.
The Trunk is also configured as a PJSIP trunk. Since the SPA3102 will register the trunk with the FreePBX server, it is configured (on the PJSIP settings tab of the trunk) for inbound registration and it is setup to receive registration. Consequently, the Sip server and Sip server port fields are greyed out.
My inbound route is set up to react to any DID.
Now, the problem occurs when I receive calls from the PSTN. In the setup that I described, I can see that the inbound call routing fails, and the log files tell me that the system is not able to identify the extension to route the calls to. The SPA 3102 is configured to copy the CID from the PSTN to the SIP communication.
So far, I have found two solutions for this problem, both are suboptimal.
First, I can instruct the SPA not to copy the CID from the PSTN. The „from:“ field will then have the PSTN trunk username, which will then match the correct “trunk” endpoint.
The downside is that I will no longer see the CID on my sip phones, so I’m not knowing who calls me, and it also prevents all further call processing based on CID.
The second solution is to configure the system to identify the IP address of the SPA3102 as belonging to the SIP trunk. I didn’t find a way to do this via the GUI, so I did this via the pjsip.identify_custom.conf:
This configuration will work, but it also means that my extension for the FXS Port on the SPA3102 can no longer register.
- Is there a way to match not only the IP address, but also the Port, so that I can distinguish between source port 5060 (FXS) and source port 5061 (FXO)?
- This setup with the identify matches seems a little awkward, are there no better solutions to this kind of setup, which should be quite common, imho.