RPORT=1024 problem

Hi, I’m having trouble configuring Asterisk with my trunk provider and it’s driving me nuts.
my local network is located behing the firewall. Asterisk is part of the local network.
The phone I created and the trunk are registered but for some reason outbound calls do not work.
The necessary ports are opened on the firewall and natted to the asterisk server.
but every time I try to make a call i have this message :

<— SIP read from
UDP:xx.xx.xx.x:5026 —>

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP
yy.yy.yy.yyy:5060;branch=z9hG4bK4ac12454;received=yy.yy.yy.yy;rport=1024

From: "260779"
sip:1000@xx.xx.xx.xx;tag=as50d2be1b

To: sip:yy.yy.yy.yy:5026;tag=as5f608801

Call-ID:
404d577150bde13b1ed2ff7a2e10912b@xx.xx.xx.xx:5060

CSeq: 102 INVITE

Server: DUMMYNAME

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE,
REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE

Supported: replaces, timer

WWW-Authenticate: Digest algorithm=MD5,
realm=“DUMMYNAME”, nonce=“535fe3c1”

Content-Length: 0

xx.xx.xx.xx being my WAN address
yy.yy.yy.yy being the SIP Provider address
The SIP Provider is using port 5026 (declared using port=5026 in the sip.conf file)
everything seems to be ok.
Dumping the packets with wireshark confirms port 5026 is used.
My provider told me this was a nat problem but i’ve tried any configuration possible for the nat value nothing seems to work. He also told me rport=1024 was the problem.
Has anyone got an idea about what is causing rport to be 1024 no matter what I try (nat=force_rport,nat=comedia or both, nat=no, nat=yes I’ve tried them all)

That would be your router. It is assigning 1024 as the external port number for the outgoing traffic.