Two pbx server need to connect together

could you please help me ,how can i connect two pbx server together on same network

You define them as trunks, but using from-internal, rather than from-pstn, as the context.

If using SIP, you would typically set registration to NONE.

IAX2 was originally designed for this, but would be something else to learn.

Google intra-company trunk for additional information.

Do these PBX servers give access to extensions accessible outside the LAN ?