sip_xmit of 0xb5a4cf90 (len 545) to xxx.xxx.xx.x:0 returned

Sometimes we are facing a problem with registring external phones to our Asterisk.
By external phones I mean phone outside the Asterisk network (so behind NAT)
In the CLI of Asterisk we see the following warnings:

sip_xmit of 0xb5a4cf90 (len 545) to xx.xx.xxx.xx:0 returned -1: Invalid argument
Any ideas what this means?

The strange thing about it is that for an long period the phones are working just fine. But when the Internet connection is lost sometime the phone’s take a long time to register themselves with in the meantime the above warning messages in the Asterisk CLI

You need to work out why it is trying to send to port 0. Was port 0 explicilty specified by the peer?

This is interesting, Port 5060 is specified bij the peer.
I’am starting to think this is a problem of the router.