Connect 2 Asterisk Servers SIP accounts

I don’t recommend you use registration, just create a static definition.

Let’s assume you have a Asterisk 1.8 PBX at the IP 10.0.0.25 called ‘Kilroy’

Let’s assume your modern asterisk PBX is at the IP of 10.10.10.100 and it’s called ‘Bozo’

To define a trunk on Bozo to send and receive calls from Kilroy you would edit your pjsip.conf and create an aor, endpoint, and an identify section.

[kilroy]
type=aor
contact=sip:10.0.0.25:5060

[kilroy]
type=endpoint
context=from-kilroy
disallow=all
allow=ulaw
aors=kilroy

[kilroy]
type=identify
endpoint=kilroy
match=10.0.0.25

On Bozo you can dial extension 100 at Kilroy PBX by dialing PJSIP/100@kilroy

When calls arrive at Bozo from Kilroy they will be matched by the identify section to the endpoint and will arrive at the context ‘from-kilroy’

On Kilroy to create you trunk to Bozo you would modify sip.conf and add a peer.

[Bozo]
type=peer
host=10.10.10.100
context=from-bozo
disallow=all
allow=ulaw

To dial extension 200 at Bozo from Kilroy you would dial SIP/200@Bozo

When calls arrive at Kilroy from Bozo they will be matched by the IP address and will arrive at the context ‘from-bozo’

1 Like