I have an Asterisk V18 installed on Ubuntu, and I configured the file pjsip.conf with the port 5065. The extensions register successfully, but when extension ‘A’ calls to extension ‘B’, the method INVITE was sent to port 5060.
You need to show what you’ve actually configured and expect, because if you configure a transport with port 5065 then that just means Asterisk will send FROM that port for its traffic, and expect traffic to be received on that port. As well if both register then Asterisk will send TO where they specify when registering, or the source IP address+port if rewrite_contact is set to “yes” on the endpoint.
It’s only a server test. It’s not in a production. When I configured PJSIP with the port 5060, the calls between extensions were successfully. These extensions are in the same local network with Asterisk Server. But, if I need to change the port (for security reasons for example), it is possible?