Jigasi time out on connecting to sip server - missing rport flag?

We are running a jitsi-docker instance, which works just fine. Now we tried to add jigasi to that, but we are experiencing issues.
Namely it can’t reach twilio which we are using for the sip termination.
Issue seems to be that the via header contains the internal ip instead of the public and twilio then tryint to reply to the internal ip, which obviously leads nowhere.

Example of a REGISTER event, whcih eventually ends up with a timeout
Jigasi 2021-05-10 15:10:25.218 FINE: [22] impl.protocol.sip.SipLogger.logDebug().111 Debug output from the JAIN-SIP stack: sendMessage 35.156.191.129/5060
messageSize = 559 message = REGISTER sip:yyyyyyyyyy.twilio.com SIP/2.0
Call-ID: ffadf438374bb61afd9ac7a33b1a23bf@0.0.0.0
CSeq: 3 REGISTER
From: “jigasi” sip:xxxxxxxxxx@yyyyyyyyyy.twilio.com;tag=722e0f63
To: “jigasi” sip:xxxxxxxxxx@yyyyyyyyyy.twilio.com
Via: SIP/2.0/UDP 192.168.64.4:5060;branch=z9hG4bK-3631-5484ee62fe93a2e060511a7358eb3a59
Max-Forwards: 70
User-Agent: Jigasi1.1.166-g929a439Linux
Expires: 600
Contact: “jigasi” sip:xxxxxxxxxx@192.168.64.4:5060;transport=udp;registering_acc=amag_pstn_frankfurt_twilio_com;expires=600
Content-Length: 0

Jigasi 2021-05-10 15:10:25.740 INFO: [22] org.jitsi.jigasi.SipGateway.registrationStateChanged().120 REG STATE CHANGE ProtocolProviderServiceSipImpl(SIP:xxxxxxxxxx@yyyyyyyyyy.twilio.com) → RegistrationStateChangeEvent[ oldState=Registering; newState=RegistrationState=Connection Failed; userRequest=false; reasonCode=-1; reason=A timeout occurred while trying to connect to the server.]

According to Jigasi SIP connection registers with wrong IP address · Issue #335 · jitsi/docker-jitsi-meet · GitHub this behaviour is normal and expected and the server end in our case twilio should implement rport (rfc3581).
Now that is all nice and all, but… the via header from our instance doesn’t even contain the rport flag and i see no way how to enable or enforce it.

After several days of scowling the internet and going through the source code and being nowhere being closer to a solution we hope someone out here can help.

The server itself is a Hetzner Server and the only thing between jitsi & jigasi and the outer world is a nftable firewall. All relevant ports should be open:
tcp: 22, 80, 443, 4443, 5061, 5349
udp: 5060, 10000, 20000-20050

Have you checked the forum, there are people using twilio.com already…

Thank you for your helpful “why don’t you google that duh” response, but yes yes I have done that and no it didn’t resolve the issue. This isn’t a twillo issue. If you don’t want to read my post or reply in a useful fashion just ignore it. Its that easy. Have a nice day.

Yes, I had used twillio in the past, and I’m not saying it is their issue, and I had read the post.
The sip part of jigasi hadn’t changed the last 5 years or more …
Maybe you can try playing with Jitsi Desktop and try to register to twillio, it will be easier to test maybe …