Assistance setting up FreePBX server

Hello. I’m new to Asterisk. I am trying to set up a phone number to receive and transmit calls. The SIP Service I am using is GoTrunk. I am struggling to understand how to set things up properly, tried many different ways but don’t seem to find it.

How do I connect gotrunk to freepbx both for inbound and outbound calls? Is there a way to test if it works without a softphone?

Then how can I connect a SoftPhone? Everything is running on a VPS so is there anything I have to change to allow softphones to connect?

Thank you for helping your fellow noob.

See User Manual - IP PBX Configuration - FreePBX | GoTrunk .
This is old and assumes chan_sip . However, I recommend that you follow it and get it working. You can switch to pjsip later.

Sure, you could route incoming calls to voicemail, an IVR, your mobile phone or a test destination such as Echo Test. For outgoing, you could set up DISA. However, I strongly recommend that you set up your softphones or other extensions first, as that is much easier to debug.

There are many free softphones. Zoiper and Linphone are good choices, because they are available for both computers and smartphones. Depending on your application, you might later upgrade to a paid app.

Thank you for your reply. I did follow that guide and I could not get my configuration to work. I need to somehow first make sure that asterisk is connected to gotrunk and then connect to the soft phone. Do you know how exactly I connect a LinPhone and how to make all of this work on a public IP? Currently I’m hosting FreePBX on a public domain, do I connect LinPhone to that or directly to the server IP?

At the Asterisk command prompt, type
sip show peers
and
pjsip show endpoints
then post the output of both commands.
Also, what, if anything, do you see wrong on LinPhone or at GoTrunk
What happens when you try to make or receive a call?
You can view the Asterisk log at Reports -> Asterisk Logfiles. If anything appears there on an attempted call (or when Linphone attempts to register), paste it at pastebin.freepbx.org and post the link here. A screenshot of your LinPhone settings would also be useful.

1 Like

There’s a really deep part of that question that saying out loud wouldn’t hurt.

That sentence is about four different, and distinct, call components. The first are the to and from legs of the linphone. You can check this by doing things like “*65” (which plays back your extension number) or *98 (which wires you into Voice Mail).

If you can’t dial in, your phone probably isn’t connecting. If that works, then talking to the PBX is going pretty well.

The second part is incoming and outgoing to your provider. Unlike the old POTS system, dial tone doesn’t actually tell you anything. When you call your Direct Inbound Dial Number (DID) from your cell phone, what happens?

Until you know your phone is connecting to the service, sending an inbound call from your provider to the phone is troubleshooting with two unknowns. The more you can verify that each direction is working for each of the connections to the PBX, the more likely you are to solve your problem.

1 Like

My asterisk console is cycling through this non stop.

Executing [s@from-sip-external:6] Set(“PJSIP/anonymous-00016fb8”, “receveip=”) in new stack
[2020-11-24 06:36:14] ERROR[193780][C-00012671]: pbx_functions.c:608 ast_func_read: Function CHANNEL not registered
– Executing [s@from-sip-external:7] Log(“PJSIP/anonymous-00016fb8”, "WARNING,"Rejecting unknown SIP connection from “”) in new stack
[2020-11-24 06:36:14] WARNING[193780][C-00012671]: Ext. s:7 @ from-sip-external: "Rejecting unknown SIP connection from "
– Executing [s@from-sip-external:8] Answer(“PJSIP/anonymous-00016fb8”, “”) in new stack
> 0x7fa4845eaa00 – Strict RTP learning after remote address set to: 192.168.1.83:25282
[2020-11-24 06:36:14] WARNING[193777][C-00012670]: pbx.c:2927 pbx_extension_helper: No application ‘Playtones’ for extension (from-sip-external, s, 11)
== Spawn extension (from-sip-external, s, 11) exited non-zero on ‘PJSIP/anonymous-00016fb7’
– Executing [h@from-sip-external:1] Hangup(“PJSIP/anonymous-00016fb7”, “”) in new stack
== Spawn extension (from-sip-external, h, 1) exited non-zero on ‘PJSIP/anonymous-00016fb7’
– Executing [s@from-sip-external:9] Wait(“PJSIP/anonymous-00016fb8”, “2”) in new stack
– Executing [s@from-sip-external:10] Playback(“PJSIP/anonymous-00016fb8”, “ss-noservice”) in new stack
– <PJSIP/anonymous-00016fb8> Playing ‘ss-noservice.ulaw’ (language ‘en’)

Several things look like FreePBX and/or Asterisk are not built correctly. Did you download and install the Distro (ISO file)? If not, what did you install? If you built it yourself, what instructions did you follow?

The log itself is somewhat garbled making it hard to interpret (because the forum treats various characters specially). Please paste e.g. the last 200 lines (from the Asterisk log, not the console) at pastebin.freepbx.org and post the link here. The Asterisk log can be viewed at Reports->Asterisk Logfiles, or you can access it directly at /var/log/asterisk/full

Do you recognize the address 192.168.1.83 e.g. as the private address of your softphone? Is the VPS on a public IPv4 address? If not, please explain the routing. Who is the cloud provider?

I followed many guides actually, I’m quite sure that I built it right, I feel like it could be something with the trunk config.

Asterisk log is spitting out errors non stop.
Restarted the server and nothing changed. I am not troubleshooting but did not find any solution yet. Deleted the trunk settings, removed all the extensions run updates and nothing. Will update if I find any solution.

Thank you.

https://pastebin.freepbx.org/view/28b9d994

So things got very weird. I found that the previous errors I posted were due to the ‘Allow SIP Guests’ setting in SIP Settings. After disabling it the errors stopped but now asterisk is spitting out very weird errors.
https://pastebin.freepbx.org/view/8b6c6595

I think that it’s trying to make some calls or something but failing. The numbers or the IPs are unfamiliar and have nothing to do with my server or trunk, What is this?

All PBX systems sitting on a public IP address will be incessantly hammered by automated hacking tools that scan every IPv4 address on the internet looking for vulnerable systems.

The official FreePBX Distro includes a software firewall that can limit access to only hosts you authorize (your trunking provider and your extensions).

Your cloud provider may have a hardware firewall between the internet and your PBX that you can configure.

Better than nothing, you can change the SIP ports to nonstandard values: In Asterisk SIP Settings, pjsip tab, change Port to Listen On from 5060 to e.g. 27146 (pick a random value between 20001 and 49999). On the chan_sip tab, change Bind Port from 5160 to a different random value. Restart Asterisk and you should now see very few of these errors. Of course, you will have to change your extensions to register to the new port. If using the fixed IP method for GoTrunk, you must specify the new port on their website.

The pastes you posted have only a few lines each. If your system is getting hammered, I would have expected hundreds or thousands of entries in the log. If you still have trouble, please paste the last few hundred lines of /var/log/asterisk/full (do so in a way that doesn’t result in escape sequences such as &quot; that do not appear in the actual log.

Thank you for your reply.

For some weird reason I think my FreePBX install does not have firewall installed. There is not firewall option under connectivity in FreePBX and when running ‘fwconsole ma upgrade firewall --edge’ I get an error saying that firewall is not a locally installed module.

How can I install the firewall, did not find much online either.

As for the ports I tried to atleast temporarily block the connections by changing them but the bots still picked up my server. Need to fix my firewall.

The bots don’t scan every port on every IP address (would take too long). But they scanned all the ports on your machine because they had already learned that you have a PBX. If you can change your public IP (perhaps by spinning up a new server and shutting down the old), you should be ok at least for a while.

The system you built probably won’t support the FreePBX firewall as it includes some closed source components. Why can’t you just run the Distro? Or run a system pre-built for your cloud platform?

What OS are you running? There is almost certainly some firewall included as part of that distribution. It’s not PBX-specific, but for now all you need is ‘block everything but your own address and the GoTrunk addresses’.

I am running on Ubuntu 20.04. How come I cannot use firewall, this is weird… And it’s hard for me to change IP at this point so I need to work with what I have. Thank you!-

As it seems like you are new to the asterisk world, I would advise doing a fresh install of the FPBX distro in a virtual machine on your laptop/desktop, and practice there first. Can setup a softphone, etc…

1 Like

Assuming that your cloud provider has some sort of ‘console’ access (so you don’t accidentally lock yourself out), then it should be easy to do what you need (allow access from only a few specific IP addresses) with
https://ubuntu.com/server/docs/security-firewall

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.