PJSIP Endpoints send INVITE to wrong port

Hi Forum,

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.

How can I fix this error?


This is a community forum, not a support system.

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.

Sorry @jcolp. Yes, it is a forum.

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?


You can change the port that Asterisk listens on. All endpoints then have to be updated to send to Asterisk on that port.

I can’t work out where in the PJSIP configuration you put the 5060.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.