No Matching Endpoint Found For Incoming Call From SIP Trunk

Home » Asterisk Users » No Matching Endpoint Found For Incoming Call From SIP Trunk
Asterisk Users 4 Comments

Hello,

I have an Asterisk 13.6.0 PBX using PJSIP connected to the Twilio gateway. I am able to make calls outbound through the gateway, but I am not able to make calls into the PBX from external PSTN.

Specifically, an incoming call is _received_ by Asterisk, but it is not able to route the call internally owing to the following error:

[Feb 18 21:08:47] NOTICE[4606]: res_pjsip/pjsip_distributor.c:347
log_unidentified_request: Request from ‘< sip:+19725551212@sillyapp.pstn.twilio.com;isup-olib;pstn-params

4 thoughts on - No Matching Endpoint Found For Incoming Call From SIP Trunk

  • ​I’ll bet that if you do a “pjsip show transport twilio”​ you won’t see any Identify or Matches. I think there’s a bug in the wizard that’s not correctly handling the “\;transport=tcp” in all cases when it’s appended to remote_hosts. I’ll check on it tomorrow.

    ​Do this instead:​

    remote_hosts = sillyapp.pstn.twilio.com server_uri_pattern = sip:${REMOTE_HOST}\;transport=TCP
    client_uri_pattern = sip:${REMOTE_HOST}\;transport=TCP
    contact_pattern = sip:${REMOTE_HOST}\;transport=TCP

    Also, make sure that your Twilio “Origination URI” has the “;transport=tcp”
    appended.

    ​I’ll be working ​on the wiki tomorrow as well. 🙂

  • Thanks George, for your mighty quick response.

    I made the changes (re: server_uri_pattern etc.) and still, no luck–it fails for the same error.

    BTW, there is nothing for transport (but this is the same config from my SIP/UDP + Twilio days, which worked):

    *CLI> pjsip show transport twilio-siptrunk Unable to find object twilio-siptrunk.

    *CLI> pjsip show identifies No objects found.

    I did add ;transport=tcp to my Origination URI after wireshark revealed everything was received as UDP into Asterisk, so we can rule out that issue
    (I confirmed that I am getting TCP based SIP INVITEs from Twilio, and confirmed that the Asterisk server sends a 401 Unauthorized for the initiation INVITE).

    Per the pjsip_wizard.conf samples, long ago, I removed pjsip.conf-based Twilio config and placed it all in pjsip_wizard.conf.

    Thanks, re: wiki, I will be using it heavily, for sure 😉

  • ​Oops. I meant pjsip show endpoint.​

    ​This is the problem. You should see something like…

    Identify: twilio-siptrunk-identify/twilio-siptrunk
    Match: 54.172.60.1/32
    Match: 54.172.60.3/32
    Match: 54.172.60.2/32
    Match: 54.172.60.0/32

    If you use the uri_patterns then your config looks OK so watch Asterisk when it starts to see if it prints any errors or warnings.

  • OK, I fixed it. Here’s what I did:

    Well, I first saw a lot of errors like this when Asterisk starts up (CLI
    messages immediately upon startup):

    [Feb 18 22:47:44] ERROR[5749]: netsock2.c:305 ast_sockaddr_resolve:
    getaddrinfo(“sillyapp.pstn.twilio.com;transport=tcp”, “(null)”, …): Name or service not known
    [Feb 18 22:47:44] ERROR[5749]: res_pjsip_endpoint_identifier_ip.c:186
    ip_identify_match_handler: Address ‘sillyapp.pstn.twilio.com;transport=tcp’
    provided on ip endpoint identifier ‘twilio-siptrunk-identify’ did not resolve to any address
    [Feb 18 22:47:44] ERROR[5749]: config_options.c:720 aco_process_var: Error parsing match=sillyapp.pstn.twilio.com;transport=tcp at line 0 of
    [Feb 18 22:47:44] ERROR[5749]: res_pjsip_config_wizard.c:329 create_object:
    Unable to apply object type ‘identify’ with id ‘twilio-siptrunk-identify’. Check preceeding errors.

    However, I _am_ able to resolve them from the host (and yes, the ports to twilio are open too):

    $ nslookup sillyapp.pstn.twilio.com Server: 172.31.0.2
    Address: 172.31.0.2#53

    Non-authoritative answer:
    Name: sillyapp.pstn.twilio.com Address: 54.172.60.1
    Name: sillyapp.pstn.twilio.com Address: 54.172.60.2
    Name: sillyapp.pstn.twilio.com Address: 54.172.60.3
    Name: sillyapp.pstn.twilio.com Address: 54.172.60.0

    What I finally did to fix this is

    [twilio-siptrunk]
    type = wizard sends_auth = yes sends_registrations = no remote_hosts = sillyapp.pstn.twilio.com server_uri_pattern = sip:${REMOTE_HOST}\;transport=tcp client_uri_pattern = sip:${REMOTE_HOST}\;transport=tcp contact_pattern = sip:${REMOTE_HOST}\;transport=tcp outbound_auth/username = gobble outbound_auth/password = degookdegook endpoint/context = from-external endpoint/disallow = all endpoint/allow = ulaw aor/qualify_frequency = 15

    (Note, if you recall my earlier post/question on this list, I removed the fix from that post (\;transport=tcp from remote_hosts) and stuck the fixes you propose in *_uri_pattern etc.)

    Now, I do see the identifies in pjsip show endpoint twilio-siptrunk:

    Identify: twilio-siptrunk-identify/twilio-siptrunk
    Match: 54.172.60.1/32
    Match: 54.172.60.2/32
    Match: 54.172.60.3/32
    Match: 54.172.60.0/32

    And my incoming and outgoing calls via twilio work.

    Phew!

    Thanks again, George. You are a lifesaver!

    On Thu, Feb 18, 2016 at 10:44 PM, George Joseph