PJSIP Trunk NAT

Hi,

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 : 172.16.28.1
Server B IP : 172.27.160.1

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

The Endpoint on server A :

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

The endpoint on server B :

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

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 10.8.2.3 to be forwarded to 172.16.28.1

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