So I am having a small issue here, don’t know why as this worked the other day for me I am sure. I am using both SIP and PJSIP as Twilio only connects through SIP but I wish to use PJSIP for my extensions. This works fine over UDP and TCP but over TLS I get a Forbidden error when I try to dial out although the extension is registered. This does not happen when I use the standard port 5061 which I can’t do as I have to use it for SIP to talk to Twilio and the PTSN. Any idea why I can’t use PJSIP on a non-default port?
See I don’t think you’ve understood the issue, that may be due to the way I wrote it. I am connected to Twilio fine on Chan_SIP using 5061 but when I try and use an extension on PJSIP via TLS on another port I get a Forbidden error when I dial any number, even internal extansions, this does not occur when I use port 5061 for PJSIP but then means I can’t connect to the PTSN does that make a little more sense?
Well, no, because you haven’t posted any logs or anything that would help someone understand the problem.
But you’ve started off with a false premise (Twilio only works with chan_sip) so I’d like to help you solve that and get your PBX configured to only have one SIP stack running. Then there won’t be any confusion about ports.
Thanks for your help Bill but I need both as the client wants to use the features of PJSIP on their extensions but Twilio uses ChanSIP so maybe I just change trunking providers maybe that’s your next idea? This should work I can’t work out what’s blocking it, as for the log a single line appears
90442[2021-01-25 17:11:20] NOTICE[C-00000012] chan_sip.c: Failed to authenticate device “1001” <sip:*** @sip.********.co.uk>;tag=7d577c1f62e542b59e90c46b278ed79f for INVITE, code = -1
Chansip and pjsip are concepts internal to Asterisk and no endpoint including Twilio knows which one you are using and it doesn’t make any difference to them.
If there is a working config for chansip, there is one for pjsip.
All that matters is that you get the config right, including the correct ports, etc.