Twilio inbound calls with PJSIP running on port 5160

Hi guys,

From reading through this forum and Twilio documentation my understanding is that to receive inbound calls, you have to configure one trunk per Twilio IP address that you might be receiving invites from, if you are using chan_sip.
To avoid having to do that you can also use PJSIP and put possible IP addresses in the match field.

So far so good, my only issue is that I have PJSIP running on port 5160 but Twilio is sending all invites to port 5060.
I guess that would mean that I have to configure my firewall in such a way (PBX behind NAT), so that incoming packets sent to port 5060 are forwarded to my PBX to port 5160 if those are coming from specific Twilio IP addresses.

Is that correct and/or is there an easier way of doing that?

Not correct. Doing NAT port redirect like that won’t work for SIP. You need to configure the provider to send invites to port 5160 and config the firewall to port forward 5160 to the PBX.

1 Like

That is unfortunately not possible with Twilio as far as I can see, so I have to look for something else.

Thanks!

Not a Twilio user, but I find this highly unlikely. If they don’t provide a specific field for the SIP port in their config options, try adding the port after a colon with the host:

XX.XX.XX.XX:5160
1 Like

Turns out you can.
Nice!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.