Asterisk/Elastix setup in AWS
-
Hi Awesome Community,
I am about to create a custom setup for Elastix v4 in AWS.
The Company already running this version on premis and now we need to make it in AWS, So
I have created an RDS MySQL and now Asterisk connects to a remote database to just make it ready for Autoscaling and be stateless, Everything is perfect to this point.I also tried to setup an AWS network Load balancer to manage the traffic between Elastix nodes "Initially 2 nodes" and also i can register normally using that NLB into my softphone, The issue that i face now is that there is no voice signal in the call although the security group of the Elastix EC2s are passing the RTP ports normally !!
Noting that when i want to make call using the Elastix nodes IP addresses , the call is perfect and voice is normal and clear.
So:
Is anyone tried to do a similar setup ?
What could be the reason behind this issue ?
Do i need to work with something like "OpenSIPs" as a load balancer instead of the AWS NLB ?Thanks
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
Is anyone tried to do a similar setup ?
Not really. For many reasons. One, Elastix is long LONG dead. It was almost dead about seven years ago, and the product was totally discontinued four and a half years ago. Under no conditions should anyone run it anywhere, it's ancient, unpatched, unmaintained, and it's just gone. It was discontinued because the product had failed, so it wasn't even in good shape when they discontinued it. We had hope that it would recover at the time, but it was failing for years and just finally got bought out and shut down. I can't think of any viable excuse for still using it even if it is still running from before, but we'd certainly never "redeploy it." If you are taking the effort to deploy something, THIS is the time to fix the fact that Elastix is still in use.
Second, AWS is not a good choice for PBX deployments. It's not bad, it's just not ideal. Extra work and extra cost. There are better options that make this all much easier (and cheaper.)
Doing a scaling, high availability setup like this with Elastix is a bizarre mismatch. The one feels like dramatic overkill for voice, what company needs voice support like that? AT&T doesn't even come close to having voice reliability in this manner. It's not that HA voice is bad, but the Fortune 100 doesn't feel that they need this, what's the use case? And in what situation can you justify all this work, but combine it with Elastix with isn't a production viable system in the slightest? These two things really don't go together.
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
What could be the reason behind this issue ?
You can't load balance voice traffic in this way. There's also no need to.
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
Do i need to work with something like "OpenSIPs" as a load balancer instead of the AWS NLB ?
You would, yes, and if you do that, what's the purpose of Asterisk behind it?
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
I have created an RDS MySQL and now Asterisk connects to a remote database to just make it ready for Autoscaling and be stateless, Everything is perfect to this point.
Let's step back to the beginning. You've got a lot of pieces here, but let's start with one big question: why?
Phones aren't something that you want to scale. Asterisk isn't a technology meant for scale. Elastix isn't a viable product at all, and not a path to viable Asterisk.
If you were going to try to build "scalable Asterisk", which I think absolutely no one would agree is a good idea - there are products meant for this and this isn't one of them, then you'd do so by building your own customer Asterisk system that's designed ground up to do this. You'd never use one of the viable Asterisk distros like FreePBX or VitalPBX, let alone an old, dead one like Elastix.
But fundamentally... what is it you are trying to do? Whatever the end goal is, what you are attempting here isn't going to be the answer. Either you need a normal phone system at a fraction of this cost and effort and that means just going the standard solutions. Or you need something that truly does scale and then Asterisk is off of the table.
-
Asterisk can't really be stateless completely, it handles the calls. So if you have a multi-node Asterisk system you need something to orchestrate the fact that separate PBXs are randomly registering different extensions and have different information. I can't think of any way to make this work because each Asterisk instance believes that it is the PBX for all of the extensions and will see most of the extensions as failing because they are attached to another instance. I think this is a dead path, I don't believe that you can make Asterisk support this.
-
The approach that you are taking is treating Asterisk as if it were a web server (like Apache), which it is not like at all. Calls are nothing like web requests. In a web scenario, even one with a database, the calls are independent and each piece of each call can go to a separate app server and neither the web server nor the browser are any the wiser. Telephony can't do that, it's a continuous stream of data in two directions with multiple live networking channels. HTTP is a stateless protocol, RTP is a stateful protocol.
Asterisk doesn't hold all of the "live state" in the database, so your shared database doesn't make the Asterisk nodes coordinated in any way. Sure they share passwords and configuration data, but they are now competing for SIP registrations each unaware of the other one. There's no data in the database that they can use to record which node is doing what, there's no nodal information anywhere, not even on the nodes themselves, and there's no communications channel between the nodes.
If you were to think about this like storage, it's like having a SAN connected to two desktops that don't know about each other. And there not being any clustered file system on the SAN. Sure, each desktop can see the same data, but they can overwrite each other and they don't know that there is another desktop they only see data changing at random without knowing why.
The cluster is split brained 100% of the time. The on top of that, we add the load balancer out front which then causes the end points (phones) to be confused, too, because they will be randomly getting connected and disconnected and thinking that they are connected by the PBX that they are connected to doesn't know what's going on. But the phones can't see the nodes, they think that it is only one.
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
Do i need to work with something like "OpenSIPs" as a load balancer instead of the AWS NLB ?
Yes and no. You need everything top to bottom to be changed. OpenSIP itself can't fix the situation, because Asterisk has no mechanism to deal with load balanced traffic. There is a company that has tried to make something to do this, but to do it they had to build a massive application stack because there's nothing on the market that can do what is needed, and they needed to modify Asterisk to do it, too.
-
@scottalanmiller said in Asterisk/Elastix setup in AWS:
@AlyRagab said in Asterisk/Elastix setup in AWS:
Do i need to work with something like "OpenSIPs" as a load balancer instead of the AWS NLB ?
Yes and no. You need everything top to bottom to be changed. OpenSIP itself can't fix the situation, because Asterisk has no mechanism to deal with load balanced traffic. There is a company that has tried to make something to do this, but to do it they had to build a massive application stack because there's nothing on the market that can do what is needed, and they needed to modify Asterisk to do it, too.
Kamilio would be the solution here.
https://www.kamailio.org/ -
@JaredBusch said in Asterisk/Elastix setup in AWS:
@scottalanmiller said in Asterisk/Elastix setup in AWS:
@AlyRagab said in Asterisk/Elastix setup in AWS:
Do i need to work with something like "OpenSIPs" as a load balancer instead of the AWS NLB ?
Yes and no. You need everything top to bottom to be changed. OpenSIP itself can't fix the situation, because Asterisk has no mechanism to deal with load balanced traffic. There is a company that has tried to make something to do this, but to do it they had to build a massive application stack because there's nothing on the market that can do what is needed, and they needed to modify Asterisk to do it, too.
Kamilio would be the solution here.
https://www.kamailio.org/Right, but INSTEAD of Asterisk not in front of it. That's the key. Asterisk isn't part of any solution here.
-
Thanks @scottalanmiller , @JaredBusch for this good discussion,
Actually it is a POC level of environment. I am convinced already that Asterisk "As a legacy app" is so difficult to make it cloud native kind of application.
For me i am away from the VoIP field since more than 4 years now, so is there any other complete solution that can be scaled and hosted in AWS ?.Thanks
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
Thanks @scottalanmiller , @JaredBusch for this good discussion,
Actually it is a POC level of environment. I am convinced already that Asterisk "As a legacy app" is so difficult to make it cloud native kind of application.
For me i am away from the VoIP field since more than 4 years now, so is there any other complete solution that can be scaled and hosted in AWS ?.Thanks
Are you trying to recreate Twilio?
-
@AlyRagab Look at Ezuce/SipxCom. They are able to scale. We used to resell it but got away form it a few years ago. Based on FreeSwitch.
-
@scottalanmiller said in Asterisk/Elastix setup in AWS:
You'd never use one of the viable Asterisk distros like FreePBX or VitalPBX, let alone an old, dead one like Elastix.Thought a few people were using FreePBX/VitalPBX here ?
-
@hobbit666 said in Asterisk/Elastix setup in AWS:
@scottalanmiller said in Asterisk/Elastix setup in AWS:
You'd never use one of the viable Asterisk distros like FreePBX or VitalPBX, let alone an old, dead one like Elastix.Thought a few people were using FreePBX/VitalPBX here ?
I think he meant in the scale-as-needed cloud-ready kind of way.
-
@hobbit666 said in Asterisk/Elastix setup in AWS:
@scottalanmiller said in Asterisk/Elastix setup in AWS:
You'd never use one of the viable Asterisk distros like FreePBX or VitalPBX, let alone an old, dead one like Elastix.Thought a few people were using FreePBX/VitalPBX here ?
You completely took that out of context.
-
@JaredBusch said in Asterisk/Elastix setup in AWS:
@hobbit666 said in Asterisk/Elastix setup in AWS:
@scottalanmiller said in Asterisk/Elastix setup in AWS:
You'd never use one of the viable Asterisk distros like FreePBX or VitalPBX, let alone an old, dead one like Elastix.Thought a few people were using FreePBX/VitalPBX here ?
You completely took that out of context.
Sorry my bad, went back through and I'll hold my hands up on that
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
Thanks @scottalanmiller , @JaredBusch for this good discussion,
Actually it is a POC level of environment. I am convinced already that Asterisk "As a legacy app" is so difficult to make it cloud native kind of application.
For me i am away from the VoIP field since more than 4 years now, so is there any other complete solution that can be scaled and hosted in AWS ?.Thanks
Asterisk is totally awesome and in no way legacy. It's a workload that has no need for "cloudification." It's not that Asterisk is legacy here, it's that cloud isn't a panacea and this is a great example of why.
You have to have a need to scale before there's a reason to create the tech. VoIP isn't something that has any purpose to this kind of scaling in the first place 99% of the time.
-
@hobbit666 said in Asterisk/Elastix setup in AWS:
@scottalanmiller said in Asterisk/Elastix setup in AWS:
You'd never use one of the viable Asterisk distros like FreePBX or VitalPBX, let alone an old, dead one like Elastix.Thought a few people were using FreePBX/VitalPBX here ?
You took that out of context. You'd never use those things for what he is trying to do. The entire point was, that even those current, modern, viable "best of breed" solutions wouldn't be used for this, let alone a product like Elastix that has no place whatsoever anywhere.
-
@AlyRagab said in Asterisk/Elastix setup in AWS:
Actually it is a POC level of environment. I am convinced already that Asterisk "As a legacy app" is so difficult to make it cloud native kind of application.
For me i am away from the VoIP field since more than 4 years now, so is there any other complete solution that can be scaled and hosted in AWS ?.You are getting things backwards. You should be responding with "oh, AWS and cloud are the wrong approaches for VoIP". It feels like you are driving with a solution and trying to find a goal. Cart before the horse. A POC of a fundamentally bad idea is still a bad idea and a waste of resources.
Is the idea of scaling VoIP interesting? Sure. Can you produce a use case for it? Maybe. But it'll be a stretch.
Does anyone make a complete solution? I doubt it. There's no market for it. The only places that could make use of it are enormous players who would make their own solution (e.g. Twilio) in order to do something unique. If you are the kind of shop that needs this, you can't really use someone else's product. If you need to do someone else's product, we can safely assume it's the wrong product for you.