I have configured Asterisk 13.13.1 with PJProject 2.5.5 and enable PJSIP as SIP driver (without compiling chan_sip).
I have the fully configured system and it's working but I have some problems with incoming calls. I have few numbers connected with my host and when I calling from any public number I noticed this info on asterisk remote console:
[Feb 24 14:27:16] NOTICE[5291]: res_pjsip/pjsip_distributor.c:525 log_failed_request: Request 'INVITE' from '"zzzzz" <sip:[email protected]>' failed for '192.168.34.1:5062' (callid: [email protected]:5062) - No matching endpoint found
And if I add the number which is calling to my Asterisk to endpoints then it's working - I can pick up this call.
How to add the possibility to allow all inbound calls?
You need to create an anonymous endpoint to accept inbound calls from unknown endpoints.
Be aware that adding an anonymous endpoint opens the system to extension scanning attacks where scanners try to find out which extensions you have configured in your system. They do this either to spam you with advertising calls, or exploit call transferring to call long distance numbers, or for some other ulterior motive.
After creating an anonymous endpoint, associate it with a context different from that used by your extensions. This prevents them from dialing long-distance through your trunks.
To add an anonymous endpoint in pjsip.conf
, add the following lines:
[anonymous]
type=endpoint
context=anonymous
disallow=all
allow=speex,g726,g722,ilbc,gsm,alaw
In the dialplan extensions.conf
:
[anonymous]
exten => _XXXXX,1,GotoIf(${DIALPLAN_EXISTS(local-extensions,${EXTEN},1)}?local-extensions,${EXTEN},1)
same => n,Hangup(1)
local-extensions
is the context listing your local extensions.