Connect two asterisk servers PJSIP

I want to connect two asterisk servers (13.2) with each other so that the connected endpoints can communicate.

How does the pjsip.conf has to look like, especially how has the trunk and registration configuration between the servers to be done? Couldn’t found any examples on that topic, only for registering with an ITSP.

Thank you!

Even outside of PJSIP could you not just create an AIX link between them?

You mean an IAX2 connection? How would you do that?

Isn’t PJSIP able to do this instead of IAX?

I don’t believe there’s any explicit guide but you could follow the examples for ITSP and normal phone[1]. One side would need to behave as if it’s connecting to an ITSP, and the other side would be configured as if a phone were connecting to it. This would allow communication between both sides.


You could use the PJSIP Wizard, There is an example in the Wiki for trunking between two hosts.

At least one side must have a fixed address and not use register. Normally both sides would have fixed addresses. This is based on chan_sip, but I doubt pjsip is any different.

You would be correct! It is no different. Can’t tell someone else where you are if you don’t know where they are.

The ideal scenario is fixed address in both side, if not you will need to register , If one of the Asterisk server doesnt know the IP address of the remote peer when you try to call you will get a 404 error