Missing something with In/Out Routes or Trunk

New to FreePBX. Have been running a Trixbox server for last 8 years. Needless to say hard drive crashed and hardware was too old to revive, so I have move to freepbx, but am having trouble with the install. Downloaded and installed the freepbx stable 64 bit iso. I have changed IP’s to static. I have one NIC and it is registering in the dashboard with traffic. I have two internal eyebeam softphones configured and working. I can call between the two of the softphones and all works as it should. The dashboard shows I have two users, and two trunks online. Problem is calls will not come into the system, and when I try to call out I get the message “all circuits are busy now”. I have 7 DID numbers from my SIP Trunk Provider that I have used for years. Not sure where these get entered into FreePBX. I have an outbound route set up, and an inbound route set up. Any help would be appreciated. If there are any logs, or other info you need, please let me know. Will get right out to you. Thanks in advance, Sam

1 Like

Looking through the sip_additional.conf file I see my inbound and outbound truck listed. In the past I have only had one trunk listed with Trixbox. Do I need it listed as both inbound trunk and outbound trunk? Also one setting “insecure=port, invite” in this file. The specs from my provider and previous pbx had it listed as “insecure=very”. How do I correct this? and, do I need to?

Nope - you’ve been using FreePBX for 8 years and just didn’t realize it. :slight_smile:

OK - I’m good with that, but I’d like to hear more about this. You say “IPs” but you only have one NIC? Tell us more about this miracle. Did you assign a local, non-routable address on your local network to your p[hone server and then NAT out to the Internet (and hence your ITSP) or are you exposing the interface out to the Internet (and running the Integrated Firewall (to protect your system) and the Adaptive Firewall (to allow ‘mobile’ clients to connect)? The answer to this is really critical and will determine how your configuration needs to be set up. In the 9 intervening versions of Asterisk since the last TrixBox release, some of the rules about how to set this stuff up have changed.

Being a TrixBox user myself, I know you are comfortable groveling through the config files, but the information in the *_additional.conf files is all available through the GUI. Remember that the settings in these files will be overwritten by FreePBX (which was true under Trixbox as well) so finding the information in the GUI is generally the preferred method.

Without knowing more about your provider, the answer to this entire discussion could be “Yes”. “No”, or “It depends”. If the provider uses the same IP addresses for inbound and outbound server traffic, you can set up the same inbound and outbound in the “peer” settings and use “type = friend” to set up the inbound and outbound trunk. If (like with mine) the inbound traffic from your ITSP comes from one address but the outbound traffic goes to a different IP at your ITSP, you may need to set them up as different trunks (fill in the PEER section with particulars for the inbound traffic and the USER for the outbound, with the type for each being PEER or USER, respectively).

The new version of Asterisk changed the semantics of that particular option (with several others) - “insecure=very” is deprecated and should be replaced in nearly all cases with the one your server specified.

Your seven DIDs some in through your trunk (assuming it’s set up on the server correctly, the network is right, and the configuration of the system is correct at the ITSP) and are distributed via your eight (one for each number plus one “any/any” route) inbound routes. There are lots of new options in the outbound routes (including fun stuff like allowing certain extensions to use specific outbound routes based on Caller ID).

Your problem set is too big to solve right now. Let’s just narrow it down one thing at a time. It sounds like your IP addressing scheme might be sketchy, so start there and work your way out.

Thank you so much for the reply. My FreePXX server is inside my network. I have Spectrum Business Class Broadband. Their modem is designed as a pass through as I have 5 static IP’s. From their modem, signals pass to a Netgear router that actual controls the static external IP. The signal is then sent to my FreeBPX server. When FreePBX was loaded it automatically set it up as DHCP. I have changed the server to have a static IP 10.0.5.53.The router and the modem were the same setup that have functioned correctly for a number of years with the Trixbox server.

Update: Incoming calls are working. I have spoken to my ISP (8x8). The can see my calls hit their server, so truck and out bound routes are working. Problem is the outgoing call is transmitting my internal IP address of the server, not the ip address from my router. Does anyone have any idea of where I would go to correct this to show the external address?

has to be something nat related, correct?

Chan_sip settings, NAT=yes?

Thanks for response, had tried that with Nat=yes and Nat =no. Either was SIP Provider (8x8) is still seeing my internal IP pass through instead of using my external IP. Since it is seeing an “unregistered” IP address it does not authenicate the call.

Still having a problem with this. Has been a week now with no outgoing calls. Have tried changing the chan_sip nat settings, trying them on and off. My voip provider (8x8) sees that outgoing calls hitting their server using my internal IP address instead of my external static IP assigned by my router. This causes the call to be rejected. I have tried different routers, and broadband modems, all with no change. The problem has to be buried deep inside a conf file some place, but I haven’t been able to find it. Any help would be appreciated as this is affecting my business and sanity.

Here are the asterisk logs showing my issue. Please let me know what is going on. Have been all over the wiki and forums and can’t find the answer.

-- Executing [[email protected]:7] Gosub("PJSIP/3599-00000038", "recordcheck,1(dontcare,out,174XXXXXXXX)") in new stack
-- Executing [[email protected]:1] NoOp("PJSIP/3599-00000038", "Starting recording check against dontcare") in new stack
-- Executing [[email protected]:2] Goto("PJSIP/3599-00000038", "dontcare") in new stack
-- Goto (sub-record-check,recordcheck,3)
-- Executing [[email protected]:3] Return("PJSIP/3599-00000038", "") in new stack
-- Executing [[email protected]:8] Return("PJSIP/3599-00000038", "") in new stack
-- Executing [[email protected]:3] ExecIf("PJSIP/3599-00000038", "0 ?Set(CDR(accountcode)=)") in new stack
-- Executing [[email protected]:4] Set("PJSIP/3599-00000038", "MOHCLASS=default") in new stack
-- Executing [[email protected]:5] Set("PJSIP/3599-00000038", "_NODEST=") in new stack
-- Executing [[email protected]:6] Macro("PJSIP/3599-00000038", "dialout-trunk,1,174XXXXXXXX,,off") in new stack
-- Executing [[email protected]:1] Set("PJSIP/3599-00000038", "DIAL_TRUNK=1") in new stack
-- Executing [[email protected]:2] GosubIf("PJSIP/3599-00000038", "0?sub-pincheck,s,1()") in new stack
-- Executing [[email protected]:3] GotoIf("PJSIP/3599-00000038", "0?disabletrunk,1") in new stack
-- Executing [[email protected]:4] Set("PJSIP/3599-00000038", "DIAL_NUMBER=174XXXXXXXX") in new stack
-- Executing [[email protected]:5] Set("PJSIP/3599-00000038", "DIAL_TRUNK_OPTIONS=Ttr") in new stack
-- Executing [[email protected]:6] Set("PJSIP/3599-00000038", "OUTBOUND_GROUP=OUT_1") in new stack
-- Executing [[email protected]:7] GotoIf("PJSIP/3599-00000038", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,9)
-- Executing [[email protected]:9] GotoIf("PJSIP/3599-00000038", "0?skipoutcid") in new stack
-- Executing [[email protected]:10] Set("PJSIP/3599-00000038", "DIAL_TRUNK_OPTIONS=T") in new stack
-- Executing [[email protected]:11] Macro("PJSIP/3599-00000038", "outbound-callerid,1") in new stack
-- Executing [[email protected]:1] ExecIf("PJSIP/3599-00000038", "0?Set(CALLERPRES(name-pres)=)") in new stack
-- Executing [[email protected]:2] ExecIf("PJSIP/3599-00000038", "0?Set(CALLERPRES(num-pres)=)") in new stack
-- Executing [[email protected]:3] ExecIf("PJSIP/3599-00000038", "0?Set(REALCALLERIDNUM=3599)") in new stack
-- Executing [[email protected]:4] GotoIf("PJSIP/3599-00000038", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,7)
-- Executing [[email protected]:7] Set("PJSIP/3599-00000038", "USEROUTCID=") in new stack
-- Executing [[email protected]:8] Set("PJSIP/3599-00000038", "EMERGENCYCID=") in new stack
-- Executing [[email protected]:9] Set("PJSIP/3599-00000038", "TRUNKOUTCID=17403344970") in new stack
-- Executing [[email protected]:10] GotoIf("PJSIP/3599-00000038", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,15)
-- Executing [[email protected]:15] ExecIf("PJSIP/3599-00000038", "1?Set(CALLERID(all)=17403344970)") in new stack
-- Executing [[email protected]:16] ExecIf("PJSIP/3599-00000038", "0?Set(CALLERID(all)=)") in new stack
-- Executing [[email protected]:17] ExecIf("PJSIP/3599-00000038", "0?Set(CALLERID(all)=)") in new stack
-- Executing [[email protected]:18] ExecIf("PJSIP/3599-00000038", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
-- Executing [[email protected]:19] ExecIf("PJSIP/3599-00000038", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
-- Executing [[email protected]:20] Set("PJSIP/3599-00000038", "CDR(outbound_cnum)=17403344970") in new stack
-- Executing [[email protected]:21] Set("PJSIP/3599-00000038", "CDR(outbound_cnam)=") in new stack
-- Executing [[email protected]:12] GosubIf("PJSIP/3599-00000038", "0?sub-flp-1,s,1()") in new stack
-- Executing [[email protected]:13] Set("PJSIP/3599-00000038", "OUTNUM=174XXXXXXXX") in new stack
-- Executing [[email protected]:14] Set("PJSIP/3599-00000038", "custom=PJSIP") in new stack
-- Executing [[email protected]:15] ExecIf("PJSIP/3599-00000038", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
-- Executing [[email protected]:16] ExecIf("PJSIP/3599-00000038", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
-- Executing [[email protected]:17] Macro("PJSIP/3599-00000038", "dialout-trunk-predial-hook,") in new stack
-- Executing [[email protected]:1] MacroExit("PJSIP/3599-00000038", "") in new stack
-- Executing [[email protected]:18] GotoIf("PJSIP/3599-00000038", "0?skipcrm") in new stack
-- Executing [[email protected]:19] Set("PJSIP/3599-00000038", "__CRM_DIRECTION=OUTBOUND") in new stack
-- Executing [[email protected]:20] Set("PJSIP/3599-00000038", "__CRM_DESTINATION=174XXXXXXXX") in new stack
-- Executing [[email protected]:21] Set("PJSIP/3599-00000038", "__CRM_SOURCE=3599") in new stack
-- Executing [[email protected]:22] AGI("PJSIP/3599-00000038", "sangomacrm.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
-- <PJSIP/3599-00000038>AGI Script sangomacrm.agi completed, returning 0
-- Executing [[email protected]:23] Set("PJSIP/3599-00000038", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
-- Executing [[email protected]:24] NoOp("PJSIP/3599-00000038", "CRM Finished") in new stack
-- Executing [[email protected]:25] GotoIf("PJSIP/3599-00000038", "0?bypass,1") in new stack
-- Executing [[email protected]:26] ExecIf("PJSIP/3599-00000038", "1?Set(CONNECTEDLINE(num,i)=174XXXXXXXX)") in new stack
-- Executing [[email protected]:27] ExecIf("PJSIP/3599-00000038", "1?Set(CONNECTEDLINE(name,i)=CID:17403344970)") in new stack
-- Executing [[email protected]:28] ExecIf("PJSIP/3599-00000038", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)17403344970)") in new stack
-- Executing [[email protected]:29] GotoIf("PJSIP/3599-00000038", "0?customtrunk") in new stack
-- Executing [[email protected]:30] Dial("PJSIP/3599-00000038", "PJSIP/[email protected],300,T") in new stack
-- Called PJSIP/[email protected]

== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:31] NoOp(“PJSIP/3599-00000038”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack
– Executing [[email protected]:32] GotoIf(“PJSIP/3599-00000038”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] Set(“PJSIP/3599-00000038”, “RC=21”) in new stack
– Executing [[email protected]:2] Goto(“PJSIP/3599-00000038”, “21,1”) in new stack
– Goto (macro-dialout-trunk,21,1)
– Executing [[email protected]:1] Goto(“PJSIP/3599-00000038”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [[email protected]:1] NoOp(“PJSIP/3599-00000038”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack
– Executing [[email protected]:2] ExecIf(“PJSIP/3599-00000038”, “1?Set(CALLERID(number)=3599)”) in new stack
– Executing [[email protected]:7] Macro(“PJSIP/3599-00000038”, “outisbusy,”) in new stack
– Executing [[email protected]:1] Progress(“PJSIP/3599-00000038”, “”) in new stack
– Executing [[email protected]:2] GotoIf(“PJSIP/3599-00000038”, “0?emergency,1”) in new stack
– Executing [[email protected]:3] GotoIf(“PJSIP/3599-00000038”, “0?intracompany,1”) in new stack
– Executing [[email protected]:4] Playback(“PJSIP/3599-00000038”, “all-circuits-busy-now&please-try-call-later, noanswer”) in new stack
– <PJSIP/3599-00000038> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en’)
> 0x7fa77402e890 – Probation passed - setting RTP source address to 24.106.158.245:54330
[2017-07-26 18:53:00] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:01] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:01] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:01] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:01] NOTICE[12924]: manager.c:3407 authenticate: 127.0.0.1 failed to authenticate as ‘admin’
[2017-07-26 18:53:01] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:01] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
– <PJSIP/3599-00000038> Playing ‘please-try-call-later.ulaw’ (language ‘en’)
[2017-07-26 18:53:02] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:02] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:03] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:03] WARNING[12909][C-00000029]: res_rtp_asterisk.c:2520 __rtp_recvfrom: PJ ICE Rx error status code: 370401 ‘Unauthorized’.
[2017-07-26 18:53:04] NOTICE[12991]: manager.c:3407 authenticate: 127.0.0.1 failed to authenticate as ‘admin’
– Executing [[email protected]:5] Congestion(“PJSIP/3599-00000038”, “20”) in new stack
[2017-07-26 18:53:04] WARNING[12909][C-00000029]: channel.c:5005 ast_prod: Prodding channel ‘PJSIP/3599-00000038’ failed
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘PJSIP/3599-00000038’ in macro ‘outisbusy’
== Spawn extension (from-internal, 174XXXXXXXX, 7) exited non-zero on ‘PJSIP/3599-00000038’
– Executing [[email protected]:1] Macro(“PJSIP/3599-00000038”, “hangupcall”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/3599-00000038”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“PJSIP/3599-00000038”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] Hangup(“PJSIP/3599-00000038”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/3599-00000038’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/3599-00000038’
– PJSIP/3599-00000038 Internal Gosub(crm-hangup,s,1) start
– Executing [[email protected]:1] NoOp(“PJSIP/3599-00000038”, “Sending Hangup to CRM”) in new stack
– Executing [[email protected]:2] NoOp(“PJSIP/3599-00000038”, “HANGUP CAUSE: 34”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/3599-00000038”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [[email protected]:4] NoOp(“PJSIP/3599-00000038”, “MASTER CHANNEL: 1501109580.57 = 1501109580.57”) in new stack
– Executing [[email protected]:5] GotoIf(“PJSIP/3599-00000038”, “0?return”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/3599-00000038”, “__CRM_HANGUP=1”) in new stack
– Executing [[email protected]:7] AGI(“PJSIP/3599-00000038”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <PJSIP/3599-00000038>AGI Script sangomacrm.agi completed, returning 0
– Executing [[email protected]:8] Return(“PJSIP/3599-00000038”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/3599-00000038’
– PJSIP/3599-00000038 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
[2017-07-26 18:53:07] NOTICE[13003]: manager.c:3407 authenticate: 127.0.0.1 failed to authenticate as 'admin’
asterisk1*CLI>

A quick call to Packet8 and asking them for troubleshooting help might not be a bad idea.