Asterisk/Elastix setup in AWS
-
@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.