Asterisk: Link 2 PBX via PJSIP
Server A
[siptrunk-auth]
type = auth
auth_type = userpass
username = <USER>
password = <ASTRONGPASSWORD>
[siptrunk-aor]
type = aor
contact = sip:serverB.domain.tld
[siptrunk]
type = endpoint
context = from-serverB
allow = !all,g722,ulaw
outbound_auth = siptrunk-auth
aors = siptrunk-aor
direct_media = no
[siptrunk-registration]
type = registration
outbound_auth = siptrunk-auth
server_uri = sip:serverB.domain.tld
client_uri = sip:<USER>@serverB.domain.tld
retry_interval = 60
[siptrunk-identify]
type = identify
match = serverB.domain.tld
endpoint = siptrunk
ServerB
[<USER>]
type = auth
auth_type = userpass
username = <USER>
password = <ASTRONGPASSWORD>
[<USER>]
type = aor
max_contacts = 1
[<USER>]
type = endpoint
context = from-ServerA
allow = !all,ulaw
direct_media = no
auth = <USER>
aors = <USER>
[<USER>]
type = identity
match = ServerA.domain.tld ; sometimes you might need to use the actuall IP Address
endpoint = <USER>