Jigasi and Twilio - can't connect to SIP trunk

Hi all!
I’ve just installed Jitsi meet on Ubuntu 18.04 through the repository which works great.
I’ve then been assigned to also install Jigasi as some of our users sometimes don’t have internet coverage so at least they’ll be able to phone into the meeting or for us to call them and have an audio.
For the SIP part, I’m trying to use Twilio as I already have an account. I thought the process will be pretty straight forward but it seems to pose some real problems for me.
I’ve configured everything in Twilio and then I’ve installed Jigasi through the repo. When it asks me for the sip user, I introduce +phonenumber@sipURI .pstn.twilio.com and for the password the one which I’ve introduced in the credentials section. Then, when I start Jigasi in the logs I always see the following and it’s never registering to Twilio(as it should?):

2019-12-12 18:23:30.025 INFO: [42] org.jitsi.jigasi.SipGateway.registrationStateChanged().105 REG STATE CHANGE ProtocolProviderServiceSipImpl(SIP:+phonenumber@sipURI .pstn.twilio.com) -> RegistrationStateChangeEvent[ oldState=Unregistered; newState=RegistrationState=Registering; reasonCode=-1; reason=null]

2019-12-12 18:24:02.091 INFO: [35] org.jitsi.jigasi.SipGateway.registrationStateChanged().105 REG STATE CHANGE ProtocolProviderServiceSipImpl(SIP:+phonenumber@sipURI .pstn.twilio.com) -> RegistrationStateChangeEvent[ oldState=Registering; newState=RegistrationState=Connection Failed; reasonCode=-1; reason=A timeout occurred while trying to connect to the server.]

PCAP says the following:

▒n▒]▒DE6▒5G▒6▒<▒▒"REGISTER sip:sipURI.pstn.twilio.com SIP/2.0
Call-ID: 3a6db50d26759f23cce29f8116a357e5@0:0:0:0:0:0:0:0
CSeq: 1 REGISTER
From: “sipURI” <sip:username@sipURI .pstn.twilio.com>;tag=46221325
To: “sipURI” <sip:username@sipURI .pstn.twilio.com>
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK-313434-592f85a7231db68282536220233963fd
Max-Forwards: 70
User-Agent: Jigasi1.1.38-g8f3c241Linux
Expires: 600
Contact: “username” <sip:sipURI@10.0.0.2:5060;transport=udp;registering_acc=sipURI _pstn_twilio_com>;expires=600
Content-Length: 0

▒n▒]▒▒DE6▒5G▒6▒<▒▒"REGISTER sip:sipURI.pstn.twilio.com SIP/2.0
Call-ID: 3a6db50d26759f23cce29f8116a357e5@0:0:0:0:0:0:0:0
CSeq: 1 REGISTER
From: “sipURI” <sip:username@sipURI .pstn.twilio.com>;tag=46221325
To: “sipURI” <sip:username@sipURI .pstn.twilio.com>
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK-313434-592f85a7231db68282536220233963fd
Max-Forwards: 70
User-Agent: Jigasi1.1.38-g8f3c241Linux
Expires: 600
Contact: “username” <sip:username@10.0.0.2:5060;transport=udp;registering_acc=sipURI _pstn_twilio_com>;expires=600
Content-Length: 0

▒n▒]▒▒DE6▒5G▒6▒<▒▒"REGISTER sip:sipURI.pstn.twilio.com SIP/2.0
Call-ID: 3a6db50d26759f23cce29f8116a357e5@0:0:0:0:0:0:0:0
CSeq: 1 REGISTER
From: “sipURI” <sip:username@sipURI .pstn.twilio.com>;tag=46221325
To: “sipURI” <sip:username@sipURI .pstn.twilio.com>
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK-313434-592f85a7231db68282536220233963fd
Max-Forwards: 70
User-Agent: Jigasi1.1.38-g8f3c241Linux
Expires: 600
Contact: “sipURI” <sip:username@10.0.0.2:5060;transport=udp;registering_acc=sipURI _pstn_twilio_com>;expires=600
Content-Length: 0

▒n▒]P▒DE6▒5G▒6▒<▒▒"REGISTER sip:sipURI.pstn.twilio.com SIP/2.0
Call-ID: 3a6db50d26759f23cce29f8116a357e5@0:0:0:0:0:0:0:0
CSeq: 1 REGISTER
From: “sipURI” <sip:username@sipURI .pstn.twilio.com>;tag=46221325
To: “sipURI” <sip:username@sipURI .pstn.twilio.com>
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK-313434-592f85a7231db68282536220233963fd
Max-Forwards: 70
User-Agent: Jigasi1.1.38-g8f3c241Linux
Expires: 600
Contact: “sipURI” <sip:sipURI@10.0.0.2:5060;transport=udp;registering_acc=sipURI _pstn_twilio_com>;expires=600
Content-Length: 0

My sip-communicator.properties file contains the following:

net.java.sip.communicator.impl.protocol.sip.acc1403273890647.ACCOUNT_UID=SIP:+phonenumber@sipURI .pstn.twilio.com
net.java.sip.communicator.impl.protocol.sip.acc1403273890647.PASSWORD=IUFPfGVrRTd0JS8pO0hHYkZk
net.java.sip.communicator.impl.protocol.sip.acc1403273890647.PROTOCOL_NAME=SIP
net.java.sip.communicator.impl.protocol.sip.acc1403273890647.SERVER_ADDRESS=sipURI .pstn.twilio.com
net.java.sip.communicator.impl.protocol.sip.acc1403273890647.USER_ID=username@sipURI .pstn.twilio.com

I have no experience at all with SIPS. My firewall is all down for both ingress and egress but it still doesn’t work.
Anyone has any experience with Twilio and Jigasi? Maybe I’m not defining the user and phone number correctly, I don’t know.
Thank you!
Radu

After a little bit of troubleshooting, I’ve managed to make it connect to the Twilio SIP Trunk but now I’m facing another issue.
When I try to call from the conference, I get the following error:

2019-12-13 15:23:42.721 SEVERE: [79] impl.protocol.sip.SipMessageFactory.throwOperationFailedException().2652 Failed to create INVITE request.
javax.sip.SipException: Dialog not yet established – no response!
2019-12-13 15:23:42.734 INFO: [79] org.jitsi.jigasi.SipGatewaySession.onConferenceCallStarted().581 [ctx=1576243421242644481208] Created outgoing call to SipGatewaySession{sipCall=Call: id=1576243422589653816755 peers=1, destination=’+mobilephonenumber’}
2019-12-13 15:23:42.789 INFO: [93] org.jitsi.jigasi.SipGatewaySession.peerStateChanged().1204 [ctx=1576243421242644481208] SIP peer state: Connecting
2019-12-13 15:23:42.978 INFO: [97] org.jitsi.jigasi.SipGatewaySession.peerStateChanged().1204 [ctx=1576243421242644481208] SIP peer state: Alerting Remote User (Ringing)
2019-12-13 15:23:43.205 INFO: [91] service.protocol.media.MediaHandler.registerDynamicPTsWithStream().1003 Dynamic PT map: 126=rtpmap:-1 telephone-event/8000; 111=rtpmap:-1 opus/48000/2 fmtp:useinbandfec=1;minptime=10; 103=rtpmap:-1 unknown/90000;
2019-12-13 15:23:43.209 INFO: [91] service.protocol.media.MediaHandler.registerDynamicPTsWithStream().1020 PT overrides [103->104 ]
2019-12-13 15:23:43.313 INFO: [91] service.protocol.media.CallPeerMediaHandler.start().1961 Starting
2019-12-13 15:23:43.625 INFO: [98] service.protocol.media.MediaHandler.registerDynamicPTsWithStream().1003 Dynamic PT map: 101=rtpmap:-1 telephone-event/8000; 96=rtpmap:-1 opus/48000/2 fmtp:usedtx=1; 98=rtpmap:-1 iLBC/8000; 97=rtpmap:-1 AMR-WB/16000;
2019-12-13 15:23:43.626 INFO: [98] service.protocol.media.MediaHandler.registerDynamicPTsWithStream().1020 PT overrides
2019-12-13 15:23:43.660 INFO: [98] org.jitsi.jigasi.SipGatewaySession.handleCallState().1123 [ctx=1576243421242644481208] Sip call IN_PROGRESS: Call: id=1576243422589653816755 peers=1
2019-12-13 15:23:43.662 INFO: [98] org.jitsi.jigasi.SipGatewaySession.handleCallState().1132 [ctx=1576243421242644481208] SIP call format used: rtpmap:0 PCMU/8000
2019-12-13 15:23:43.665 INFO: [98] org.jitsi.jigasi.SipGatewaySession.peerStateChanged().1204 [ctx=1576243421242644481208] SIP peer state: Connected
2019-12-13 15:23:43.666 INFO: [98] service.protocol.media.CallPeerMediaHandler.start().1961 Starting
2019-12-13 15:23:44.057 INFO: [98] service.protocol.media.TransportManager.sendHolePunchPacket().552 Send NAT hole punch packets
2019-12-13 15:23:44.061 INFO: [91] org.jitsi.jigasi.JvbConference.callStateChanged().1122 [ctx=1576243421242644481208] JVB conference call IN_PROGRESS.
2019-12-13 15:23:45.664 SEVERE: [112] org.jitsi.jigasi.SipGatewaySession.run().1057 [ctx=1576243421242644481208] Stopped receiving RTP for Call: id=1576243422589653816755 peers=1
2019-12-13 15:23:55.505 INFO: [151] org.jitsi.jigasi.SipGatewaySession.handleCallState().1138 [ctx=1576243421242644481208] SIP call ended: CallPeerChangeEvent: type=CallPeerStatusChange oldV=net.java.sip.communicator.service.protocol.CallPeerState:Connected newV=net.java.sip.communicator.service.protocol.CallPeerState:Disconnected for peer=+mobilephonenumber <+mobilephonenumber@domain .sip.us1.twilio.com>;status=Disconnected
2019-12-13 15:23:55.513 INFO: [151] org.jitsi.jigasi.SipGatewaySession.peerStateChanged().1204 [ctx=1576243421242644481208] SIP peer state: Disconnected
2019-12-13 15:24:00.514 INFO: [152] org.jitsi.jigasi.SipGatewaySession.sipCallEnded().629 [ctx=1576243421242644481208] Sip call ended: Call: id=1576243422589653816755 peers=0
2019-12-13 15:24:00.522 INFO: [152] org.jitsi.jigasi.JvbConference.stop().500 [ctx=1576243421242644481208] Removing account Jabber:173920be@meet .domain.com/173920be
2019-12-13 15:24:00.535 INFO: [152] impl.protocol.jabber.OperationSetBasicTelephonyJabberImpl.registrationStateChanged().132 Jingle : OFF
2019-12-13 15:24:00.539 INFO: [152] org.jitsi.jigasi.AbstractGateway.notifyCallEnded().128 [ctx=1576243421242644481208] Removed session for call. Sessions:0
2019-12-13 15:24:00.550 SEVERE: [157] org.jitsi.jigasi.JvbConference.callStateChanged().1114 [ctx=1576243421242644481208] Call change event for different call ? Call: id=15762434219281239972572 peers=0 : null
2019-12-13 15:24:00.565 SEVERE: [99] org.jitsi.impl.neomedia.RTPConnectorOutputStream.log() Failed to send a packet to target /INTERNAL_IP:10000:java.io.IOException: No active socket.
2019-12-13 15:24:00.565 SEVERE: [157] org.jitsi.impl.neomedia.RTPConnectorOutputStream.log() Failed to send a packet to target /INTERNAL_IP:10000:java.io.IOException: No active socket.

When I try to call the conference, I get the following error:

2019-12-13 15:27:59.266 SEVERE: [192] impl.protocol.sip.SipStackSharing.findTargetFor().922 no listeners
2019-12-13 15:27:59.267 SEVERE: [192] impl.protocol.sip.SipStackSharing.processRequest().709 couldn’t find a ProtocolProviderServiceSipImpl to dispatch to

The logs from Twilio look like this:

INVITE
sip:+TWILIO_PHONE_NUMBER@meet.domain.com
2019-12-13 13:27:59 UTC
Request
URL
sip://+TWILIO_PHONE_NUMBER@meet.domain.com
ParametersShow Raw
|To|“sip:+TWILIO_PHONE_NUMBER@meet.domain.com”|
| — | — |
|From|“sip:+MOBILEPHONENUMBER@domain.pstn.twilio.com;tag=56386654_6772d868_06cc428f-40c9-4fae-a127-6b65352e3596”|
Message TextShow Raw
|Msg|“Request timeout with sip:+TWILIO_PHONE_NUMBER@meet.domain.com”|
| — | — |
|ErrorCode|“32011”|
|LogLevel|“WARN”|
Response
Headers
ReasonPhrase Request Timeout
StatusCode 408
Body
No body.

What could I do to narrow down the problem?
Regards,
Radu