Asterisk cluster; res_ais, DUNDi or something else?

projects
projects used Ask the Experts™
on
I need to build a highly reliable and scalable asterisk cluster (who doesn't). It will have two WAN connections on the local LAN and additional WAN connections in other physical locations to ensure better up times. I especially like the idea of using DNS SRV.

In reading about Asterisk clustering, it can get pretty complex rather quickly. While the task itself is obviously not for the weak, the most complex part seems to be in being able to find all of the information needed to accomplish the task, and to have a good, all the way through direction.

Now I see that res_ais is now included with 1.6 (which we are running) and I've also read about the DUNDi method. Based on my having two WANs at one location and wanting additional locations, should I be looking at something else or is either of these two a good solution?

I have a lot of hardware (servers) so hardware is not an issue, the solution, using open source (as in free beer), initially, definitely is. The trunks are in PRI/SIP gateway form along with some SIP trunks from Internet providers.

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012

Commented:
DUNDI is probably going to be your best bet. I don't have any direct experience with clustering, but DUNDI was designed to move / query information between multiple systems. If no one else has an immediate answer, I'll look it up for you.

Author

Commented:
Thanks for your input. Let's give it a little time and see if we get more replies.
DUNDi does sound like a good solution, just want to make sure I don't spin my wheels. It's so easy to get caught up in a project that lasts weeks only to find out it's not the solution.
Most Valuable Expert 2012

Commented:
HAHA!

I have figured it out.

You need: func_odbc.

This is an extremely cool function in the Asterisk dialplan.

It allows you to connect to a central database of stored information such as numbers, CID, and other data.

The advised way is to setup a postgres db, and then setup the database connector.
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Author

Commented:
Looking this up, it sounds more like a hack than a proper solution which I could build on. I'm not a programmer and don't want to get into all sorts of database modifications and other such things.

I have found countless projects and methods by searching around but was hoping for input which might help me pick a project which I could get long term use of.

Most Valuable Expert 2012

Commented:
func_odbc is NOT a hack. It is a full blown asterisk application to query a database, and pass SQL statements to the database.

You wanted something more robust than DUNDI. This is it.

This function, which allows asterisk to interact directly with postgres databases (or another if you configure it differently)  is the basis for enterprise solutions such as SwtichVox among others.

Integrating Asterisk with databases is one of the fundamental elements allowing clustering of Asterisk into a large, distributed system. func_odbc allows you to define SQL queries to which you assign function names. In effect, you are creating custom functions that obtain their results by executing queries against a database.

Author

Commented:
I take it back then. I quickly looked on google and it seemed to be a hack. Based on your reply, I will spend more time on looking into this next. Is this something which can be added into my existing asterisk servers? Since I have not yet decided what I'll be using, everything is set up as stand alone servers right now.

I would love to find a project where I don't have to rebuild servers, using my existing ones.

Thanks.
Most Valuable Expert 2012

Commented:
What distro are your existing servers on?

I am currently writing an article for EE on how to set up the foundational phase of clustering asterisk boxes. I use Ubuntu, and therefore all my articles use Ubuntu.

But, if you're using another distribution, you should be easily able to "translate" it to the existing boxes.

The simple answer to your question is yes, but it depends on how your asterisk boxes are setup.

If you have hand coded the dialplan, then there should be no problem what so ever, if you are using a GUI to manage the boxes, then you are limited by the functionality provided in the GUI. I don't know of ANY GUI's that will allow you to cluster.

Author

Commented:
I've been using trixbox in production for the last three years. I have been migrating things over to elastix lately as it has more of the features I need.
The systems are centos based running on bladecenter blades and yes, using the freepbx gui currently since the people running the day to day stuff aren't techs so need the gui.
If I could migrate the gui to something else, I might be able to do that or let them use the gui for day to day things and have another gui for the dial plans if there is something better. The gui side is important.

Author

Commented:
If you would like real life input on how things go based on your article, I would be happy to work with you. It might give you insight on how things go for the average person while at the same time helping me get to a working solution.

Just a thought.
Most Valuable Expert 2012

Commented:
I am a hand coder. I do everything the "asterisk" way because it makes asterisk into a swiss army knife of telephony.

The bad news is: if you need the GUI you can't cluster.

Each of those packages you are using (like FreePBX) is a software application unto itself. That means that if it doesn't directly support clustering and the postgres database for centralized information, you're out of luck.

You could, however, if it is extremely important and you have a budget hire some peopel to modify the code of the GUI to talk to a centralized database; however, based on your post it sounds like that is not an option.

Your only option (that I can think of) would be to run an OpenSER proxy server to decide where to send the calls, and then run 100% duplicated boxes for redundancy. But that will be a voicemail nightmare.

Author

Commented:
Hiring isn't an option mostly because we've not once had good luck doing that. Everyone we have ever hired to do something for us has screwed something up, left things hanging or worse, made it much more complicated than it should have been. Being tired of those messes, I need to take these things on myself.

I didn't recall reading that the DUNDi solution was without a gui. If there really is no gui option for what we need to do, and since reliability, resiliency is terribly important, then we don't have any choice.

One of the IP PBX systems that we use is called sipxecs and with that one, I use a couple of SBCs (OpenSBC) on two WAN connections which proxy the registrations. This is in fact what I wanted to do initially, just use SBCs in front of the asterisk servers, and have multiple servers. However, it always boils down to servers needing to know about registrations on the others in order for everything to work right and that's where I'm at.

Isn't using OpenSER about the same as using OpenSBC? I mean, these are the functions we're talking about right?
As to the voice mail nightmare, why not have stand alone VM?
Most Valuable Expert 2012

Commented:
Re: hiring. Yeah. I totally understand that. I cannot tell you the number of times I was hired to clean up messes left by other "asterisk guys".

As far as I know there is no GUI that has built in clustering. From what I understand of the architecture (I am also a PHP / C / Perl coder on the Linux side and .NET programmer on the Windows Side), there is not a way, currently, to integrate those packages to support clustering in the manner in which a cluster should be designed.

While I am not familiar with OpenSBC, it might be the same. A registration server does only one thing: authenticate users, and hand off the call using SIP so that the registration server is no longer in the call path. If OpenSBC does that, then you're in the clear.

You could do stand alone VM, but now we're adding yet another box that has to be redundant. It's not as clean as storing VM in a PostgreSQL DB that can be replicated. :-(

Author

Commented:
Oh these tough economic times are difficult to handle. No budget to do anything it seems.

So, being a GUI/freepbx environment, my not being a programmer, I need to plan out some way to accomplish a change over to a cluster if this is what I'll be needing.

I mentioned the stand alone VM because that seems to be one way of handling things. It seems that voice mails would need to be available to all servers in the cluster so if not stand alone, then what, something shared between the servers in the cluster?

Yes, OpenSBC does that or at least does that with the other IP PBX we use which unlike asterisk, doesn't handle the media directly.

Most Valuable Expert 2012

Commented:
I don't see a way out of this one without being able to at least do custom dial plans. Which is kind of like programming, but much simpler. But if you do that, you loose the GUI interface.

In order to cluster, you have to centralize in some way, shape, or form so that the clustered boxes are all working from the same dial plan, rules, voice mails, etc... Otherwise, you can't roll over to the other boxes reliably.

Author

Commented:
Ok, so in the end, I am still not sure which project to take on. I have existing elastix (asterisk) PBX servers which I am using so need to use this with.

Author

Commented:
Anyone?
Most Valuable Expert 2012

Commented:
What do you mean "which project". I thought there was only one: clustering. To which, there is no solution for you at this time because you require a GUI.

Author

Commented:
It doesn't have to be clustering, it could be simply multiple boxes, fail over, load balancing but the end result is that I am seeking a reliable, highly available solution for remote users.
Most Valuable Expert 2012

Commented:
The simplest option there is create duplicate machines, and use OpenSIPS (http://www.opensips.org/) as the front end proxy.

If one machine goes down, you might have a temporary voice mail loss. To prevent that, run RAID 5 at a minmum, RAID 10 is preferred.

So, setup one server on a RAID 10 array, get it fully configured then image it over to another identical server. Finally, put an OpenSIPS proxy registration server in front of it. Configure OpenSIPS to always use server 1 when it's available.

Author

Commented:
OpenSBC acts as a registrar also which is what I'm using.
I also came across two interesting parts of the puzzle. One is using a load balancer like ultra monkey which is sip aware and the other is known as asterisk real time database. Seems doing these two things along with my sbc front end would do the trick.

I can easily have mirror copies of my blades and the storage is SAN based so very simple to handle and of course is RAID. But my main concern is being able to have an asterisk farm, even distributed, perhaps not a cluster, but with shared database so that all servers know about registrations, where, etc.

That's what I am needing to accomplish.
Most Valuable Expert 2012
Commented:
I understand that.

Asterisk farm = cluster.

You CANNOT do what you want to do without losing the GUI.

The best you're going to be able to do and keep the GUI is is use OpenSBC to control the failover (if it supports it) and mirror your installations. It will not be centralized.

If you want to have a centralized farm (cluster) you have to lose the GUI.

Author

Commented:
I think these terms have different meanings to some :).

In distributed, I mean stand alone servers with a front end load balancer to keeps track of available servers, sending connections to the next least busy should one become unavailable.

Cluster to me means servers which are interconnected in some way or share processes or read/write data storage such as my GFS based clusters.

Either way, you say a cluster or distributed environment doesn't exist which has a GUI. I have to believe you but have to hope there is something out there that perhaps isn't so well known yet. Maybe I've not come across it yet. There are so many projects.

http://www.voip-info.org/wiki/view/Asterisk+GUI

Most Valuable Expert 2012

Commented:
You are correct. Under normal situations, distributed and cluster would be slightly different. However, asterisk is not a website sending data in an out-only manner. it receives telephone calls and voice mails.

Therefore, you have to have a cluster.

Author

Commented:
Might you be able to suggest a solution which I could look into (project) which might be a good start for a first time user?
Most Valuable Expert 2012

Commented:
Read the Oreilly book, which is free from here:
http://www.asteriskdocs.org/

Author

Commented:
I have that book. I'm not totally new to telephony, I'm just looking for leads based on what I've asked about :)

Author

Commented:
I wish one could edit posted items.

What I mean above is that I have found a number of ideas on how to go about getting higher reliability but am concerned about spending a ton of time on one which won't quite fit my needs. Everyone has their own favorites and when I posted this, I was hoping to get enough input based on other peoples uses that I could pick a direction.
As things stand now, I'm back to where I was, unsure of which method I should try out but have gotten a lot of good input from you which I appreciate.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial