Inbound & Outbound Fail

I’ve installed and configured FreePBX All but calling in and out seem to be functioning as expected.

However, outbound calls get the message “All circuits are busy now” and all inbound calls get the message “The number you have dialed is not in service”.

I have configured and re-configured the Trunk and all seems good there. The incoming uses only the register string 2xxxxxx2:[email protected]
the outgoing uses
;allow=g729 ;uncomment this line if you have G.729 licenses installed.

These settings are the same as what was used on the previous FreePBX that crashed earlier this week. It had been running and working fine for two years.

For lack of a better term/explanation > This is a PCAP opened in wireshark:
9.255734 13.565079 “Customercare”<sip:[email protected]:5160 “18148531111”<sip:[email protected]:5160 SIP 8 REJECTED INVITE 401 503

I’ve run all this by our provider “Flowroute” and they say it looks like the server is refusing the connection/call. But that the call isn’t hitting their system at all.

The FreePBX server is sending SIP Registration to them and they are getting that. I can see that every couple of minutes the registration time there is renewed.

Two days into this. Your help is greatly appreciated.

If I’ve said something here that sounds silly to you or I’ve called something by the wrong name, please just explain that rather than mocking and belittling. Sorry. I’ve seen a lot of that while looking for help in the FreePBX community forums.

Thank You,

This reads like the line from Caddy Shack - “If we kill all the golfer, won’t we get into trouble.” It struck me as funny - sorry. A huge part of the point of the system is calling in and out.

So, to fix the problem:

First, double check your ports and Channel Driver choices. The system comes with two SIP drivers - Chan-SIP and PJ-SIP. They are assigned to different ports (5060 and 5160 is common). Note that the port is only important for the inbound.

Second, set up the trunk.

If your provider is using the same IP address for both inbound and outbound, you can set up a single “Peer” (outgoing) definition using “Type=Friend”. This sets up both your incoming and outgoing configuration.

Important distinction here: a trunk is only the “gateway” to the system. It doesn’t have inbound or outbound - it has a “Peer” configuration (which is where the system can send calls) and a “User” configuration (which is the “opening” for people to send you calls). It doesn’t make the call or the connection, it merely provides an opening for the calls to flow through. Because of this distinction, there’s no real “inbound” or “outbound” for a trunk. It’s just a very particular “hole” into and out of your network.

If you are using username and secret, you will only need a Register command if your provider wants one. You should probably lose the fromdomain, unless that is really what your domain is (on the outgoing). I don’t see a port number - what port is flowroute using? Are you doing any NAT between you and your provider? If so, you’ll need to configure that as well.

Third, set up your inbound and outbound routes. These are needed to actually route calls into and out of your PBX. To start, set up an inbound route with no Direct In Dial (DID) and no Caller ID (CID). This will allow your system to process the inbound calls. When you get that working, set up your outbound route so that the outbound calls are configured correctly for your provider. Also, make sure your Caller ID information is correct. Some providers do not allow outbound calls with “foreign” caller IDs.

That should get you started.

I went to Settings > Asterisk Sip Settings and on the General Tab changed NAT from yes to never. It still doesn’t work in or outbound and now the NAT Yes, No, Never… options are gone. It just says that These settings apply to both chan_sip and chan_pjsip. I don’t understand why the buttons have gone away.

In the Asterisk Sip Settings I change Allow Anonymous Caller ID from no to yes and now inbound works.

That’s a bad idea.
For the incoming call issue post the complete incoming INVITE in readable format.
For outgoing call issue post your INVITE and ITSPs response (usually 40X or 603 message).
Then someone should be able to suggest the further steps.

ITSP provided instructions are here:

Hey Andrew,
Flowroute actually turned me onto that same article. Funny thing is that just after messing with ports and then reverting all ports, restart machine and both in and outbound work. So just for clarification - in Settings Menu > Asterisk Sip Settings on the chan sip tab Bind Port was already 5160 and TLS was 5161 I changed TLS to 5160. Then on the pjsip tab I change the Port to listen on to 5160. The box lit up RED. Didn’t mention why, it just turned red. I tried submitting and I don’t remember if it let me or not. But, in the end I change them all back to the original port settings. Restarted and everything works. Maybe God was testing me. I have to say that I just about cracked! LOL It doesn’t help that I only have to deal with this stuff every two or three years. Set it and forget it I always say.

Thank You all very much,

I’m guessing that one of your trunk ports is now 5060, and that’s what it’s working. If you set the all to 5160, the machine will complain and set them to “compatible” settings for you. You can’t have PJ-SIP and Chan-SIP on the same port. Doesn’t work that way.