[RESOLVED]Can't receive incoming DID call -No matching endp

I want to register a real phone number for my extension (let’s say 6005) at asterisk. The goal is to be able to receive calls from outside and also to display the real phone number as its id when I make external calls. As a first step, I bought a DID number (from buyddinumber.com) and tried to redirect calls to 6005 at my asterisk-server. Buyddinumber.com provided with configuration, but I believe it is for chan_sip and I am using chan_pjsip. I am kind of lost and hoping that somebody can help me to find a way.

I added the following into my pjsip.endpoint.conf

[46.19.210.14] host=46.19.210.14 dtmfmode=rfc2833 dtmf=rfc2833 type=peer context=from-buyddinumber insecure=very nat=never allow=all
In my extensions.conf

[from-buyddinumber] exten=>43720775225,1,Dial(PJSIP/6500)

43720775225 is the number I received from this provider. When I make a call to this number, I get the following error message:

What could be the cause?

The full PJSIP log is here:

[code]<— Received SIP request (859 bytes) from UDP:46.19.210.14:5060 —>
INVITE sip:43720775225@asterisk-server SIP/2.0
Via: SIP/2.0/UDP 46.19.210.14;branch=z9hG4bKuSXkUafi;rport
From: 436815975919 sip:436815975919@46.19.210.14;tag=3F42C01E-55F1A18C00090350-19B16700
To: sip:43720775225@asterisk-server
CSeq: 10 INVITE
Call-ID: 13-10BA6371-55F1A18C000903A2-19B16700
Contact: sip:46.19.210.14:5060
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE
Diversion: sip:+43720775225@sip.didww.com;reason=unconditional
User-Agent: DIDWW SBC Node
Content-Type: application/sdp
Content-Length: 310

v=0
o=- 3824000309 3824000310 IN IP4 46.19.210.22
s=-
t=0 0
m=audio 42458 RTP/AVP 0 8 18 4 101
c=IN IP4 46.19.210.22
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=ptime:20
a=direction:both

[2015-09-10 17:28:12] NOTICE[20256]: res_pjsip/pjsip_distributor.c:256 log_unidentified_request: Request from ‘“436815975919” sip:436815975919@46.19.210.14’ failed for ‘46.19.210.14:5060’ (callid: 13-10BA6371-55F1A18C000903A2-19B16700) - No matching endpoint found
<— Transmitting SIP response (539 bytes) to UDP:46.19.210.14:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 46.19.210.14;rport=5060;received=46.19.210.14;branch=z9hG4bKuSXkUafi
Call-ID: 13-10BA6371-55F1A18C000903A2-19B16700
From: “436815975919” sip:436815975919@46.19.210.14;tag=3F42C01E-55F1A18C00090350-19B16700
To: sip:43720775225@asterisk-server;tag=z9hG4bKuSXkUafi
CSeq: 10 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1441898892/dd42944376baf518ff0ba14ddf050bce”,opaque=“2637479079071842”,algorithm=md5,qop="auth"
Server: FPBX-AsteriskNOW-12.0.74(13.5.0)
Content-Length: 0

<— Received SIP request (315 bytes) from UDP:46.19.210.14:5060 —>
ACK sip:43720775225@asterisk-server SIP/2.0
Via: SIP/2.0/UDP 46.19.210.14;branch=z9hG4bKuSXkUafi;rport
From: 436815975919 sip:436815975919@46.19.210.14;tag=3F42C01E-55F1A18C00090350-19B16700
To: sip:43720775225@asterisk-server;tag=z9hG4bKuSXkUafi
Call-ID: 13-10BA6371-55F1A18C000903A2-19B16700
CSeq: 10 ACK[/code]

I believe insecure=very is beyond deprecated and is no longer accepted. In fact, I would be surprised if pjsip ever accepted it.

With the old SIP driver, using remotesecret is preferable to using secret and insecure=invite. insecure=port isn’t normally needed on UDP transports.

The above is indeed for chan_sip. Example configurations for PJSIP are here[1].

[1] wiki.asterisk.org/wiki/display/ … n+Examples

Thank you guys for replying! I used FreePBX GUI to set it up, and it worked fine :smile:
I tried to attach the snapshot of my settings, but I couldn’t do it here. If someone needs it, send me a message on this forum.