HT503 No matching endpoint found

Hi,
I configured a Grandstream HT503 as FXO gateway on FreePBX 14 with Asterisk 14 following the guide at https://wiki.freepbx.org/pages/viewpage.action?pageId=33293313 and configuring the trunk on FreePBX.

After configuring the HT503 device and my FreePBX system I can make outgoing calls but if I try to make an incoming call from my mobile phone I hear the ringtones, but the configured extension for the Incoming Route does not ring, and I get these errors into the Asterisk console:

[2017-10-10 19:50:05] NOTICE[14511]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 
'INVITE' from '<sip:[my_mobile_number]@192.168.61.1>' failed for '192.168.61.11:5160' (callid: [email protected]) - No matching endpoint found
[2017-10-10 19:50:05] NOTICE[14511]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 
'INVITE' from '<sip:[my_mobile_number]@192.168.61.1>' failed for '192.168.61.11:5160' (callid: [email protected]) - No matching endpoint found
[2017-10-10 19:50:05] NOTICE[14511]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request 'INVITE' from '<sip:[my_mobile_number]@192.168.61.1>' failed for '192.168.61.11:5160' (callid: [email protected]) - Failed to authenticate

I configured a chan_sip trunk for the HT503, but it seems that the HT503 is using a chan_pjsip trunk (or there should be something not clear to me).
My FreePBX system is using the default ports (so port 5160 for chan_sip and 5060 for chan_pjsip) and I configured the port 5160 for the “Unconditional Call Forward to VOIP / Sip Destination Port” into the basic settings of the HT503.

I added a new Incoming route in FreePBX as described on the wiki page, but it seems that it is not called when I make an incoming call.

Could you help me please?

That might be how you wanted it set up, but clearly the HT503 is talking to port 5160, but your system’s PJ-SIP driver is answering the call. Looks like you got the PJ-SIP and Chan-SIP channels backwards.

But chan_sip is binding to 0.0.0.0 port 5160 in the SIP Settings.
What’s wrong?

PJ-SIP Answered the request that came in on port 5160. Something is clearly not working the way you want it to. Have you restarted Asterisk since making your last set of changes? Another possibility is that the HT503 isn’t actually talking to port 5160, regardless of how it’s configured.

A tcpdump for that host address might give you more information.