Configuring Twillio

I have googled around a lot and tried so many things. I am sure the answer is very simple, but I can’t figure it out.

We use Sipstation and are very happy with it.

We have Twillio as an outbound sip trunk for backup in case Sipstation fails and for some international calls. This works since a long time.

Now I was asked to add an inbound number to Twillio as well that could be used if Sipstation is down.

I now have a number in Twillio and their Elastic SIP Trunking Origination settings point it to my FreePBX. And I have created an inbound route for that number.

I did not change the configuration of that sip trunk as it is working fine outbound. But inbound I can not get it to work.

6[2020-11-14 14:42:29] NOTICE[19702] res_pjsip/pjsip_distributor.c: Request ‘INVITE’ from ‘<sip:[email protected]>’ failed for ‘’ (callid: [email protected]) - No matching endpoint found

I have tried setting Twillio to sip: and sips: and the ports 5060, 5061, and 5160. Nothing worked.

Any hints?

What is your trunk settings?
(PJSIP guide)

Yes I know that document.

I have had this trunk since many years. In the outgoing setting:

Nothing in the incoming settings.

This is a SIP trunk not a PJSIP.

The invite is coming in on the PJSIP port.

Thanks, Lorne. So that means I need to configure this trunk as PJSIP and delete the old configuration?

That or send the inbound calls to the correct port.

1 Like

The only port that I have open right now is 5061. I am trying to point Twillio to that port, but it does not work.

NOTICE[11377] res_pjsip/pjsip_distributor.c: Request ‘INVITE’ from ‘<sip:[email protected]>’ failed for ‘’ (callid: [email protected]) - No matching endpoint found

I also tried
but that does not even show up in the logs.

I guess I need to use a different port as Twillio uses PJSIP only?

Seems like Twilio uses 5060 only, and you have PJSIP on 5060.
Try setting up a PJSIP Trunk.

Okay, I have it solved. Test calls came in from different IPs than my cell phone tests.

I had to enable all IPs.

I did this in the pjsip setting, advanced, Match (Permit) and added all IPs there.


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