PJSIP transports use incorrect external_ip_address by incoming call

FreePBX 15.0.17.37 (Asterisk 15.7.4)
I have in some outbound route two trunks: 1st and 2nd. Each trunk (PJSIP, use UDP, settings method from Custom transport in PJSIP, possible from GUI? ), has one’s pair of different external IP (signaling and media – PBX works behind NAT and use registering on VoIP provider PBX ). I have two ISP (main and additional) – each trunk belongs to one’s ISP. But VoIP provider has only one pair (IP+port). Problem starts when 1st trunk fall (ISP provider channel down) and my Freepbx start using 2nd trunk/transport. When I call outbound – all works fine. But, if I receive call – I don’t hear caller. Using SNGREP utility I see – in message 200OK my PBX send:

v=0
o=- 1791434153 1791434155 IN IP4 (ipaddres 1st trunk/transport )
s=Asterisk
c=IN IP4 (ipaddres 1st trunk/transport )

but 1st doesn’t work already. It is off, any packets can’t go through this tunnel, and 2nd trunk only works. 2nd trunk is registered, 1st is unregistered (even blocked by our routerboard – only one tunnel works in same time – it is rule to avoid using wrong trunk to register through, otherwise Freepbx doesn’t know correctly what trunk/transport is down or not and don’t switch to next trunk pointed in outbound route table). This occur only by inbound call. It is bag or incorrect settings?
It looks like my PBX for incoming call uses external IP setting parameter from first trunk in sequence from Trunks table . Maybe someone advise me ? Thanks.
p.s. If I disable 1st trunk manually (using GUI) - all works properly, my PBX send correct IP parameter about external media IP address and audio is two way.

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