Twilio SIP Setup

I’m trying to setup FreePBX (AsteriskNOW) to use a Twilio SIP trunk and when I call into my PBX, it never completes the call. When I look at the logs I see,

[2015-08-18 22:58:39] NOTICE[14519]: res_pjsip/pjsip_distributor.c:256 log_unidentified_request: Request from ‘“702” <sip:+1702 @ sip .us1. twilio. com>’ failed for ‘54.172.60.3:5060’ (callid: 53604ba603cff5d0af222c88f24a4bc7 @ 0.0.0.0) - No matching endpoint found

These just repeat until I hang up.

My first thought was to question whether or not Asterisk is listening on port 5060. When I checked, it seems to be on port 5038 but I see no way to change it.

I’m not sure if these are separate issues or they are related. When I do core show version, I get,

ASterisk 13.2.0 build by mockbuild [at email addr] on a x86_64 running Linux on 2015-02-13 00:03:26 UTC

FreePBX shows: 12.0.74

Did you search the wiki and/or the fora for Twilio yet?

Asterisk is listening on quite a few ports, 5060 and 5038 , IAX2 MGCP etc. in the “distro” perhaps more but 5038 is the AMI port, that is just a security risk so not your immediate problem… Identify the channel driver you are using for SIP on 5060 (perhaps SIP, perhaps PJSIP) and properly set up those extensions.

I ended up finding a consultant to do this for me. Here are the PEER Details that I think ultimately made it work.

host=[ourhost].pstn.us1.twilio.com
type=friend
disallow=all
allow=alaw&ulaw
context=from-pstn
insecure=port,invite
nat=port,comedia