Incorect ip:port in contact field

Hello,
I have the following setup:
Zoiper (extension with NAT set) -> linux GW (with NAT 5066->5060 ant RTP 10001-20000) -> FreePBX
The issue is that the pbx responds to an invite with the wrong contact address:
10.0.1.254.28588 > 10.0.1.103.5060: SIP, length: 1074
INVITE sip:*97@homedomain:5066;transport=UDP SIP/2.0
Contact: sip:100@zoiperpublicip:port;transport=UDP
To: sip:*97@homedomain:5066;transport=UDP
From: sip:100@homedomain:5066;transport=UDP;tag=ddeeb904
10.0.1.103.5060 > 10.0.1.254.28588: SIP, length: 539
SIP/2.0 100 Trying
From: sip:100@homedomain:5066;transport=UDP;tag=ddeeb904
To: sip:*97@homedomain:5066;transport=UDP
CSeq: 2 INVITE
Server: FPBX-12.0.70(11.14.2)
Contact: sip:*[email protected]:5060
also i had to set media_address with the public ip to make the rtp work
Please tell me what i need to set in order to work.
because of the pbx response the call is dropped after 30 seconds because all the responses from the zoiper are going towards the private ip as stated in the contact field from the pbx reply

more info from confs

sip_general_additional.conf
nat=force_rport,comedia
localnet=10.0.1.0/255.255.255.0
externhost=homedomain
externrefresh=60
externip=homeexternalip

sip_additional.conf contains:
[100]
deny=
secret=******
dtmfmode=auto
canreinvite=no
context=from-internal
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=auto_force_rport,auto_comedia
port=
qualify=no
qualifyfreq=120
transport=udp
avpf=no
force_avp=no
icesupport=no
encryption=no
callgroup=
pickupgroup=
dial=SIP/100
mailbox=100@default
permit=
callerid=******<100>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic