Unable to bind new PJSIP trunk to new IP

Hello Asterisk experts,

I have an Asterisk 13.8-cert4 server.

Two ethernet interfaces on the same physical ethernet cable are as follows:

inet 10.36.1.234/30 brd 10.36.1.235 scope global eth0:1
inet 10.42.1.242/30 brd 10.42.1.243 scope global eth0:3

We have two SIP trunks (k and z) as follows:

===========================
[k-transport]
type=transport
protocol=udp
bind=10.36.1.234:5060

[z-transport]
type=transport
protocol=udp
bind=10.42.1.242:5083

[k]
type=endpoint
transport=k-transport
context=fromk
aors=k
direct_media=no
force_rport=yes
rtp_symmetric=yes
rewrite_contact=no

[z]
type=endpoint
transport=z-transport
context=fromz
aors=z
direct_media=no
force_rport=yes
rtp_symmetric=yes
rewrite_contact=no

[k]
type=aor
contact=sip:8.18.248.36:5060
qualify_frequency=60

[z]
type=aor
contact=sip:8.18.252.10:5083
qualify_frequency=60

[k]
type=identify
endpoint=k
match=8.18.248.36

[z]
type=identify
endpoint=z
match=8.18.252.10

The problem is in the bind address for z endpoint. It’s being bind to 10.36.1.234:5083 (the k bind IP with z bind port) instead of 10.42.1.242:5083 :

localhost*CLI> pjsip show endpoint k

Endpoint: k In use 3 of inf
Aor: k 0
Contact: k/sip:8.18.248.36:5060 41079c9907 Unavail 0.000
Transport: k-transport udp 0 0 10.36.1.234:5060
Identify: k/k
Match: 8.18.248.36/32

localhost*CLI> pjsip show endpoint z

Endpoint: z Not in use 0 of inf
Aor: z 0
Contact: z/sip:8.18.252.10:5083 53a7955766 Avail 5.132
Transport: z-transport udp 0 0 10.36.1.234:5083
Identify: z/z
Match: 8.18.252.10/32

Any help resolving this is highly appreciated.

What does the console say it is binding to when starting up Asterisk?

Would you please remind me how to log the output of asterisk startup command, then I can see what it does say?

I remember it was something similar to:

asterisk => /var/log/startup.txt

Is it correct? I would make it once only as it will require stopping Asterisk for testing this.

It is configured in logger.conf, you can send every level to a file. You can also just shut down Asterisk, run it in console, copy/paste the output to a text document, and then restart Asterisk normally.