Unable to recieve inbound calls

I’ve downloaded a recent version of the FreePBX distro (3.211.63-6-x86_64-Full-1363361091) and installed it. I have a Polycom 501 connected and have created an extension. I am able to place outbound calls (local and LD) via a Cisco 2821. However, I’m unable to recieve inbound calls from this gateway. When I place a call, it connects a play the msg “The number you have dialed is not in service”. I feel good about the gateway configuration as it is working fine with an older FreePBX installation (2.8.1).

I’m afraid that I know very little about debugging Asterisk. Any suggestions on how I should go about troubleshooting this issue?


  • Paul

The gateway is sending ‘1274’ to Asterisk.

I meant inbound.

You show an inbound DID of 1274, I believe. Most DIDS are the full 10 digit number. What are the DIDS that your provider is sending?


Sounds like you don’t have an inbound route for the digits the 2811 is sending.

You didn’t mention anything about how your outbound routes are set up. That’s where I’d start first.


Here’s a look at the inbound route that was automagically created when the extension was created -


Does this seem to be in order? A ‘debug ccsip all’ on the 2821 shows the SIP header contains “INVITE sip:[email protected]:5060 SIP/2.0”. Would Asterisk interpret the DID to be 1274 in this case?

  • Paul

I didn’t realize that the outbound route configuration had any effect on an inbound call. That’s interesting (and unexpected). Here’s a look at the only outbound route on the system -


If you can point to a reference for how the outbound route config can affect inbound calls, I’d really appreciate it. Trying to find any resource I can to help resolve this issue!

  • Paul

Yes, on an inbound call the dialed digits form the DID.

Need Asterisk log, is the call hitting the right trunk and in what context?

Perhaps you need an inbound route that ties DID 1274 to extension 1274 if your context is from-pstn, perhaps you need the tie trunk have context from-internal (or better yet, a subset of from-internal) to have access to those endpoints.

Is this in one of the /var/log/asterisk logs, or is there a debug command that needs to be run?

  • Paul

I changed the option “Allow Anonymous Inbound SIP calls” to ‘Yes’ and I can now receive calls. After reading the description of this option, I’m still not sure why this worked. If it worked because it allowed calls from “an unknown IP source”, I’d like to know what more I need to do to make the router a known source. It does show up in the output of ‘sip show peers’. If it worked because it allows URI dialing, then I am left to wonder if any SIP peer could qualify as a non-anonymous source.

I’d really appreciate any insight into this. If there is some additional data you’d like to see, please let me know.


  • Paul

Your trunk is setup wrong, goes back to my context comment, what is your trunk config?

Here’s a screenshot of the trunk config -


  • Paul

That trunk has no incoming peer set.

I named the User Context “CiscoRouterInbound” and added the following to the User Details -


I then changed “Allow Anonymous Inbound SIP Calls” to ‘No’. Inbound calls are now back to being answered with “The number you have dialed is not in service”. Obviously, I missed something. I’d appreciate any other suggestions/guidance.

  • Paul

The Cisco 2821 shows up as “Unmonitored” in the output of ‘sip show peers’. Is this the reason the Asterisk says “Received incoming SIP connection from unknown peer to 1274” when it receives an inbound call from this router? Does the peer have to be registered (or whatever status “OK” means in ‘sip show peers’) before Asterisk will match the incoming source IP with a peer configuration? Any guidance on how to go about registering a Cisco router (IOS 12.4.22T) with Asterisk?

It says “unmonitored” because you don’t have “qualify=yes” but this is not causing the problem. Your trunk is still not configured correctly.

Here is what I have for one of my locations that is using a Cisco 2801 with a PRI. I can’t say it is the best configuration but it is working.

You need the context= part for sure.


The User Details in the Incoming Settings for this trunk now look like this -


Inbound calls are now coming in to the correct context and being received by the phones. Experimenting shows that it was the “insecure=port” that was the key.

  • Paul

Experimenting shows that it was the “insecure=port” that was the key.

We’ve found “insecure=invite,port” to be reliable with our vsp, however these settings are influenced by so many variables, YMMV.