I am trying to configure a trunk between my 2 asterisk in pjsip.

I followed this tutorial: https://stackoverflow.com/questions/37422603/building-channels-trunks-between-two-asterisk-servers-with-pjsip

The concern is that when I call from server A to server B, it is not using the right endpoint (and therefore the wrong context)

Server A IP :
Server B IP :

Identify Server A : ‘siptrunk-identify’, ‘siptrunk’, ‘’, NULL, NULL
Identify Server B : ‘Balayage’, ‘Balayage’, ‘’, ‘NULL’, NULL

The Endpoint on server A :

Endpoint: siptrunk Not in use 0 of inf
Aor: siptrunk-aor 0
Contact: siptrunk-aor/sip: e3ad1685c3 NonQual nan
Transport: transport-udp udp 0 0
Identify: siptrunk-identify/siptrunk

The endpoint on server B :

Endpoint: Balayage Not in use 0 of inf
InAuth: Balayage/Balayage
Aor: Balayage 1
Contact: Balayage/sip:s@ 2e62adfd96 Avail 16.809
Transport: transport-udp udp 0 0
Identify: Balayage/Balayage

Did you have an idea for this problem

You’re going to need to show a SIP trace using “pjsip set logger on” as well as describe what exactly happens, not just that it matches the wrong endpoint. What endpoint is it matching?

it matches with the “Anonymous” endpoint. I use it for my provider

I notice that the contact ip is the WAN address of my router for server A. If I fill in this ip to identify it on server B, server A sends me back "Endpoint: ‘siptrunk’: Unable to create request with auth. No auth credentials for realm (s) ‘asterisk’ in challenge.
I created a NAT rule to forward anything that comes on to be forwarded to

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.