SIP/2.0 404 Not_Found

Hi,

I’m facing an issue for the first time. I have a SIP trunk that is successfully registered with the provider. I’m able to do outgoing calls. Incoming calls are not working. Our SIP provider is giving us the below trace:

U 2017/06/15 11:18:04.732776 69.10.37.184:5060 -> OUR_IP:5060
SIP/2.0 404 Not Found.
Via: SIP/2.0/UDP ISP_IP;branch=z9hG4bKa042.dc260921.0;received=ISP_IP.
From: “011441143199998” sip:011441143199998@magictelecom.com;tag=763e951e2e9380172eea6cad52226b3c.
To: sip:17187021767@OUR_IP;tag=as7f3ca2a8.
Call-ID: DP1.192.4712263.
CSeq: 108426679 INVITE.
Server: FPBX-13.0.192.8(13.16.0).
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
Content-Length: 0.

Any ideas?

You would need to provide the console output of Asterisk. It’s entirely possible that the incoming call is using a target that is not configured in FreePBX, and thus gets a 404 Not Found.

Thanks for the quick reply. What command should I use in CLI?

See https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information#CollectingDebugInformation-Enablechanneltechorfeaturespecificdebug

Also, if using the ITSP’s logs, you need the INVITE, not just the rejection, as you need to see what the request URI was. (This information will be in the Asterisk logs.)

here are the logs I get on my FreePBX:
[2017-06-15 21:35:06] VERBOSE[2171][C-000001ef] netsock2.c: Using SIP RTP TOS bits 184
[2017-06-15 21:35:06] VERBOSE[2171][C-000001ef] netsock2.c: Using SIP RTP CoS mark 5
[2017-06-15 21:35:06] NOTICE[2171][C-000001ef] chan_sip.c: Call from ‘marwan’ (ISP_IP:5060) to extension ‘OUR_DID’ rejected because extension not found in context ‘inbound_trunk_name’.

Both outgoing and incoming trunks are online:
cloudpbx*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
inbound_trunk_name/marwan ISP_IP No No 5060 Unmonitored
outbound_trunk_name/marwan IP No No 5060 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]

I would recommend looking for FreePBX support on their community site at https://community.freepbx.org

Most of the users of this site deal with raw asterisk fundamentals not configurations created and managed by a GUI.

Like @jcolp said, this seems the culprit. You have a call coming into the inbound_trunk_name context, and there’s no handler for it. Configuring a handler in FreePBX is outside the purview of this community forum - the FreePBX community forum may be able to offer guidance for how they want users to do that.

Were you configuring Asterisk (not configuring FreePBX, which in turn configures Asterisk as it sees fit), you’d want to read up on the Dialplan [1], in particular, extensions[2].

Cheers

[1] - Home - Asterisk Documentation
[2] - Home - Asterisk Documentation

I was thinking if someone who really know Asterisk could help with the logical reason bhind this, I would be able to fix it on FreePBX.
Do dial plans affect incoming calls? I thought only outgoing calls.

Yes.

A call from a SIP phone registered to Asterisk to an IVR, or Conference Bridge, or any other application provided by Asterisk is an incoming call.
A call from a SIP Phone through Asterisk to a SIP Provider has both an incoming (Phone) and an outgoing (Provider) leg.
A call from your SIP Provider into Asterisk and then out to your SIP Phone has both an incoming (Provider) and an outgoing (Phone) leg.

1 Like

Dialplans affect calls. Asterisk does not know the difference between “incoming” and “outgoing” calls. As far as it is concerned, the ITSP is trying to call Extension (Asterisk terminology, FreePBX uses it somewhat differently) OUR_DID, and the default context for the peer that represents your ITSP is inbound_trunk_name. There is no extension OUR_DID in that context, so Asterisk returns number unobtainable.

1 Like