I’m trying to connect a new installation of FreePBX with a ChimeSDK SIP trunk. I got it to work for both inbound and outbound by disabling all authentication options (and by sacrificing a few goats). However, enabling any kind of authentication on the trunk causes problems:
If I enable “Authentication = Outbound” on the FreePBX side, then the ChimeSDK doesn’t reply to any SIP OPTIONS and the trunk stays in an “unavailable” state (I’m using the “pjsip list endpoints” command).
If I enabled “Authentication = Both”, then I see SIP OPTIONS replies from the ChimeSDK and the trunk changes to a “Not in use state”. At this point, I can make outbound calls from FreePBX, however, inbound calls fail with an “401 Unauthorized” error message.
Interestingly, the ChimeSDK “Termination” tab has a field for setting up the authentication credentials. However, the “Origination” tab (which is the part that receives calls from FreePBX) does not have any credential/authentication related settings. This led me to believe that setting the FreePBX authentication to “outbound” only was the right thing to do, but as noted above, that didn’t work either.
This doesn’t make sense. Only outbound authentication is used for those OPTIONS requests!
Not replying to OPTIONS indicates either a broken SIP implementation, or a real transport level failure (IP packets being lost in transit). If received, any well formed request packet should produce, at least, method not implemented.
This is the expected result of enabling inbound authentication for a SIP provider, so the whole bit about 401 is not worth any further investigation.
I compared the OPTIONS ping from FreePBX with the different config options and it turns out that the “To” field is different depending on how you set it up:
I got the “authentication = outbound” OPTIONS to work by deleting the username from the pjsip tab and moving it to the “Username auth” field. Then I renamed the SIP trunk (general tab) to “voiceconnector2.voiceconnector.chime.aws”.
The ChimeSDK now replies to the SIP OPTIONS ping with a 200 OK and the trunk is up. However, now when I make an outbound call, I get a “401 Unauthorized” error.