Insane idea: Asterisk/FreePBX or FreeSWITCH for a Google Voice alternative?

This may not be the best community for this discussion, but I thought it might be worth trying. In my ever-growing desire to rid all things Google from my life, I’ve been searching for something to replace Google Voice. To be clear, I just want to replace the voicemail part of it, not the multi-phone forwarding, phone-number-in-the-cloud, and messaging components. All I would want is a way to send voicemail to a private server where I can provide a greeting, record voicemails, and listen to voicemails. Transcription would be cool, but that’s undoubtedly beyond the scope of a project like this.

Yes, there are several hosted solutions on the market, but I wondered if there was a way to make a self-hosted solution (possibly in conjunction with Nextcloud). I’ve found a small handful of posts such as this one where someone claimed that they were able to make it happen:

The two most promising projects out there are Asterisk/FreePBX and FreeSWITCH, so I spun up a VM of each on AWS . . . and was immediately overwhelmed. I know nothing about SIP, PBX, and the rest, and I haven’t the faintest idea how to set up something like this. Any thoughts?

1 Like

I’ve been running a self hosted PBX for a couple years now. There are certainly other options out there for free, but most of them are based on asterisk like freepbx (I do not recommend that one). I’ve had success with Issabel, Wazo, and recently switched to VitalPBX (about as easy as it can get). Asterisk systems can be extremely complex, but at the same time with a friendly user interface can be set up relatively simply. I have not ventured into the freeswitch or 3cx worlds, but have heard very good things about both.

The most basic fundamentals you need to understand once you install a PBX are setting up a SIP trunk, then setting up inbound and outbound routes (at least one each direction), then finally adding extensions. Your SIP provider usually provides some instructions for the trunk settings and sometimes troubleshooting assistance. I’ve been using VoIP.ms and highly recommend them for cheap but reliable service (US and Canada). What’s nice about them is they have kind of a hosted PBX included in the service, so you can actually connect directly, and even set up failover so if your PBX goes down, reroute calls to another number or voicemail (they host that).

So for me, I pay $0.85/month for my DID plus $0.01/minute. It doesn’t get any cheaper than that besides the “free” Google voice.

If you host your own PBX, then you can freely do really cool stuff like voicemail to email, IVRs, ring groups, scheduling, and more.

I don’t think any of this has any bearing on nextcloud, nor would I recommend even going down that path. It’s a completely different beast and in my opinion not something that should be an add on app because of its complexity (under the hood).

Regarding hosting, you would probably want to pick a host that specializes in PBX hosting, or run your own. I just run a VM on ESXi, but people also do this on raspberry pi.

I hope this is helpful. A good resource I’ve used is nerdvittles.com, although I would recommend building a vanilla system and not using their mega “incredible PBX” scripts because they include lots of stuff you’ll never use. If you’re going for free, easy and reliable I’d recommend VitalPBX.

If you’re still planning on using your Google voice number for all of this, it’s not going to work (or not easily) and just remember they will always be recording everything that goes through their systems even if you do your own voicemail. Plus if you get it working they can change their protocol at any time, like they just did not long ago, breaking many setups like this. So like I said, VoIP.ms is really good but there are many other sip providers out there that have good features and are cheap. I think another good option is flowroute but I haven’t tried anything else.

1 Like

My own use case may be a bit simpler, but thanks for starting this thread. It may help me when I dig into this further.

I just want NextCloud Talk to connect with people via POTS, so a VoIP client integrated into the Nextcloud server would be sufficient. And, yes, I would like inbound VoIP calls to ring the NextCloud Talk app on my phone, if the phone has an internet connection, or else fall back to mobile voice. All too complicated for me to work on right now.

I’ll be following your links, thanks!

I think @linucksrox has a point that this is a bit complex to shove into Nextcloud as an app, but I believe there’s still a use-case. For instance, instead of having this be a single app unto itself (which I would agree is not a path to pursue), perhaps it could work like OnlyOffice or Collabora. The PBX/VoIP system runs as a standalone VM, and a Nextcloud app provides a connector to that instance for integration (perhaps in conjunction with Nextcloud Talk as @sbw suggested). Thoughts?

Also, I appreciate the feedback, @linucksrox, but in all honesty . . . about the only things I understood from your post were “VM on ESXi” and “Raspberry Pi.” Beyond that, I’m lost - my knowledge in PBX/VoIP tech and lingo is novice at best. I think I need a diagram.

I don’t have much experience with Nextcloud Talk, but I believe it’s a very different thing than a PBX like Asterisk. Like you mentioned, maybe this can take the approach of OnlyOffice/Collabora where there is a different VM or Docker image that integrates with Nextcloud. My question would be what exactly are you integrating? Off the top of my head, it could be minor things like storing voicemails in your cloud (probably much easier ways to handle this) and tying in with Nextcloud Talk, but I’m not sure how the two things would work together. I could be wrong, but it seems like you would either use Nextcloud Talk (based on spreed.me) or your PBX, but not both together.

I’m happy to talk more about PBX installation and setup if you want to, I’m not an expert by any means either, just have a little experience in my home lab.

My personal use-case is simple. I just want my own self-hosted “answering machine in the cloud.” The biggest thing I don’t understand is how to tell my phone to connect to my server when a caller is sent to voicemail. When setting up Google Voice for the first time, you dial some weird #12345# number that programs your phone to point to Google Voice (or something like that), but I have zero idea how that works or how their servers receive incoming voicemail connections.

It sounds like @sbw is wanting a VoIP > POTS bridge, and that’s something I think you need a paid service to provide (SIP trunk? Is that what those do? No idea).

Gotta love merging technologies from 50 years ago with cloud services. I want a Google Cloud Print connected ditto machine, next. :wink:

@summersab, I’m a little fuzzy on the terminology (SIP trunk?), but I’m looking more for a Nextcloud Talk > POTS bridge. I’d like to use Talk for all my calls, just for consistency. And I’d like to bring people unfamiliar with Nextcloud into my Talk teleconferences.

I use VoIP.ms already for many of my calls to POTS. There are many such VoIP providers. On my Android phone, I use the Linphone open source VoIP client. Could the Nextcloud Talk app gain a VoIP client and use it to connect to contacts for whom I have only a POTS number? If so, that wouldn’t require a PBX to be integrated with the Nextcloud server.

That’s my use case. I understand others need a full PBX.

If you’re talking about replacing Google with your own private server to do this: https://support.google.com/voice/answer/165656?co=GENIE.Platform%3DDesktop&hl=en
Then you can pretty much do that with something like Voip.ms without running your own server. Basically you set up conditional call forwarding: if you don’t answer your phone, then forward the call to Google’s PBX which launches directly to a voicemail box (instead of ringing). So on your phone, you could just change the forward number to something you set up on voip.ms, and then just configure the settings for that number in voip.ms to go directly to a voicemail box. That phone number you set up on voip.ms is called a DID (direct inward dial).

Here’s the thing: it seems simple enough to just “foward to voicemail” but really that is a full blown PBX system that can handle incoming calls and is simply configured to connect right to a voicemail box. So even if you wanted to only implement the voicemail aspect in Nextcloud, it would need to be able to route that incoming call using something like Asterisk under the hood.

@sbw They appear to have that functionality according to to the product page(https://nextcloud.com/talk/), but I don’t know much more than that. You might want to browse their issue tracker for more ideas, or install the spreed app and look at it yourself.

Oh, I didn’t imagine that it was “simple.” I just have no idea how it works, what technology/terminology is involved, or how to even begin. Since this is uncharted territory for me, I have no idea if it’s a mammoth undertaking or just a few hours of work guided by some diagrams and documentation (which I have yet to find, but I’m probably not using the right search terms).

Is it even possible or reasonably feasible to self-host a PBX system like VirtualPBX or Asterisk so I can handle “incoming calls” that are sent to a voicemail inbox? Voip.ms looks like it would do it, but I wondered if it would be possible to self-host just the voicemail aspect of a service like that.

Yep you could set up a PBX in a virtual machine in a few hours. I mentioned it in my first response, but basically you connect your PBX to VoIP.ms, that’s your sip trunk. It’s connected at the account level. On voipms, you have a DID, that’s your phone number. You configure that DID so that incoming calls go to your PBX. Then on your PBX you set up incoming calls on that sip trunk to go to a voicemail box.

I don’t have a diagram, but the flow in your case would be Jimmy calls your cell 555-1111 and you don’t answer. That gets forwarded from your mobile carrier to your DID 555-2222 which flows into VoIP.ms. They take that and forward to your PBX, and you take the voicemail.

I don’t know of any way to bypass VoIP.ms if that’s what you’re looking for. At that point I would just stop there and forget about hosting a PBX if you don’t need any other features (or maintenance headache).

I work with developing systems like this. And to be able to do it you need to work your way around a sip based pbx. You also need to setup a sip trunk from a provider to get calls to that pbx (there are quite a few to get a number from. sip.ms is just one of many). Then you need to script it so that it would answer for calls forwarded to it and take a message. When done it could dump it in a nextcloud controlled folder.

There are guides on how to do this. But it is not something done in minutes. voip-info.org is a good start and read up on asterisk (or others … there are more but most howtos are written around asterisk)

I got tired of all the problematic ways and not intuitive interfaces and config files to do it so i developed my own system for handling it with asterisk as a base and selling it to smaller operators. And since i work with Nextcloud as well I have a few ways of integrating it. But not with Talk since it does not have an out of the box sip transport support.

1 Like

This actually explains SO much - thanks! Knowing the flow of how that works and the terminology to go with it is what I needed. In short, I need to have someone provide the DID, and VoIP.ms is one of those providers? Makes sense.

What would be required, and would you need a separate service to provide a DID?

One VERY promising offering I found is https://www.youmail.com/. They have a free tier that is limited to 100 saved messages, but considering I don’t get many voicemails at all, that’s pretty sufficient. They also have an API, so I’m sure there’s a way to integrate it with Nextcloud or (possibly) save voicemails to Nextcloud so you don’t go over your limit. A self-hosted system would still be nice so I could put up my own walled-garden, but this at least frees me from one more Google solution.

Correct, VoIP.ms is one of many sip trunk providers who can provide you a DID.

I hadn’t heard of Youmail before but that definitely sounds like it will do what you want and take Google out of the equation. Might as well try it out. I glanced at their API but didn’t see anything promising as far as getting new voicemail notifications and fetching them for some kind of nextcloud integration. That would be pretty cool. But if you’re the only user, it probably won’t be hard to download a copy of the message from the app and sync it manually with your nextcloud (or maybe even set up a custom sync folder in the nextcloud app).

Exactly. If worst comes to worst, I’ve done some truly naughty things with curl to make “API calls” . . .

Is there anyway to make sip calls work with nexttalk? My company uses WebEx service and would like to move over to our own hosted system.

Only with Nextclouds high performance backend and that is expensive.

So there isn’t an app that can be wrote?

It can probably be written. But it is not something simple :slight_smile:

You can check this SIP client for Nextcloud: SIP Trip Phone.

It can be connected directly to the SIP provider, if the provider allows direct connections from WebRTC applications, or it can be connected to the provider via Asterisk. You can install Asterisk on your VPS, alongside Nextcloud, then connect Asterisk to a SIP provider like Telnyx or Localphone, so that you can use a real phone number located in a country of your choice, acquired from the SIP provider, to make and receive phone calls to/from any phone number in the world.

It has complete documentation on how to configure it, as well as on how to install Asterisk, which can be used to implement advanced PBX features, such as: voice menu, voicemail, queue management, music on hold, number blacklisting, call recording, audio conference calls, etc.

If you want to send/receive SMS messages and faxes in Nextcloud, please see SMS Relentless and Pax Fax respectively.

If in addition to audio phone calls you need video calls, video conferences and text chat, you can use Roundpin, but this is a standalone application, independent from Nextcloud.

Feedback is welcome.