This will trunk two asterisk servers together. Once you have them trunked you can add dial rules to dial extensions on each PBX.
Here's an example of a configuration between pbx1 <-> pbx2
Goto the "TRUNKS" GUI screen.
PBX1
"Outgoing settings"
Trunk name= pbx2
Peer Details:
host=hostname or ip of pbx2
secret=12345abdce
type=friend
username=pbx2
Incoming settings
User Context = pbx1
context=from-internal
disallow=all
host=hostname or ip of pbx2
secret=12345abdce
type=user
username=pbx1
On PBX2
Trunkname= pbx1
peerdetails:
allow=gsm,ulaw
host=hostname or ip of pbx1
secret=12345abcde
type=friend
username=pbx1
Incoming Settings
User Context = pbx2
allow=gsm,ulaw
context=from-internal
host=hostname or ip of pbx1
secret=12345abcde
type=user
username=pbx2
Now add 8| in dial rules to dail 8 to access other server
Now, goto "Outbound Routes" and on pbx1, you add a route that will let you dial pbx2 and a route one pbx2 to dial pbx1.
So, for example, if pbx1 is extensions 500-550 and pbx2 is 600-650, then your pbx1 outbound route "Dialpattern" would be
6XX
then in the drop down box, you would select the "pbx2" next to Trunk Sequence.
In pbx2, you would goto outbound routes, in the dial pattern box you would put in
5XX
then the Trunk Sequence would be "pbx1"
So, now on pbx1, you dial 600, the 6. would match and send the call to pbx2 and ring extension 600.
Same with PBX2 when you dial 500, it would pass the call to pbx.