We have freePBX distro 14 with asterisk 13.
freePBX has an interface with a privateIP and a public IP.
We are settting up a pjsip trunk from freePBX.
Registration Packet has all fields as expected by the provider.
Below is the register packet will all correct fields (anonymized for this forum):
Are you saying the machine has network interfaces on both the internet and your private network? If so, you do not have a public address and local networks in Asterisk terms, but you do have an environment where direct media is broken, so whilst not configuring the former, you need to make sure that direct media is disabled.
Also, please note that Asterisk 13 is security risk, as it is fully beyond end of life and will not receive any security fixes.
You don’t seem to have a connection to the internet, so you will need a NAT router. The purpose of configuring the public address on Asterisk is so that it can compensate for the presence of the NAT router. Even if you set the public address as the IP source address, you would still need the NAT router to handle incoming packets.
(It is possible to have the the public internet and a private network sharing the same physical LAN and interface, with only some machines listening to the public address, but I doubt that is anyone would want to do this.)
If you have both a private and a public IP, each of them in their respective NIC, you need to establish only one default gateway.
In my installs with 2 NICs, I usually define the default gateway on the private IP NIC and define static routes on the public IP NIC for the VoIP provider’s IP.
This way, if the private net has internet access, all FreePBX software upgrades go through the private net without interfering with the VoIP traffic to your VoIP provider.
In my FreePBXs, the public IP is connecting the PBX directly to the VoIP provider, so there is no NAT involved. You need to set that public IP on the SIP settings. Double check this setting, so that the correct IP is set. The NAT on the private network is not involved in this connection, so it should not interfere.
I’m using CHAN_SIP, but I understand there shouldn’t be any difference if you are using PJSIP. Just to be sure, check the PJSIP tab and verify if there is a similar setting for External IP, I don’t remember if there is or isn’t.
A slight update from my side. Thank you for pointers, they seemed to have work.
Below is the solution identified until now that solved the problem of the originating IP in the REGISTER request.
Put public IP on a different interface.
This gave me the option of two transports, which I then had to select from the pjsip trunk settings.
As stated in my last post INVITES are going using the proper transport method (public IP).
However I notice that SIP options related to this trunk are not being replied to using the correct transport method. Does anyone have any ideas as to why this may be?