Issue with inbound calls in freepbx17

i setup freepbx trunk that is connect to gsm gateway from dinstar. i can make outbound calls with no issue but the problem with inbound calls I see the log message:
NOTICE[2419]: res_pjsip/pjsip_distributor.c:673 log_failed_request: Request ‘INVITE’ from ‘“+0xxxxxxxxxxx” sip:[email protected]’ failed for ‘192.168.0.161:5060’ (callid: [email protected]) - Failed to authenticate.

One or more of:

  • Asterisk failed to identify the call as coming from the gateway,
  • FreePBX was configured for inbound authentication, but had the wrong password;
  • FreePBX was configured for inbound or bothway authentication, but the gateway was configured for no authentication, or only for outbound.

If you are using a chan_sip trunk (you shouldn’t), the Dinstar is sending the call to port 5060; set it to send to whatever Bind Port for chan_sip is set to (default is 5160).

If a pjsip trunk statically configured, set Match (Permit) to the IP address of the Dinstar (192.168.0.161 in your example).

If a pjsip trunk where the Dinstar registers to FreePBX, set Match Inbound Authentication to Auth Username and set Authentication to Both.

Not related to your problem, but this seems wrong – there are no country codes that start with 0.

solved After i configured the trunk option Match Inbound Authentication set to auth username it was set to default.