Greetings! I've been playing around with "clustering" some Asterisk servers for sake of fail-over and load balancing with DNS round-robin, and came to one problem. If I have, say, 2 servers, and clients register either on 1 or 2, how can I route extensions between them? I mean, if today user with extension 101 is registered on server1, and tomorrow he will register with server2 - how would any of servers know where to route it? As some examples, if I have only 2 servers, things are not so bad. I can use Dial(SIP/101&SIP/server2/101) on server1 and vice versa. OR, I can check the hungup code, and if it's 34 (or whatever I get when I try to dial unavailable peer) - try it on another server. But I guess things get tricky when you have 3 or more servers, and besides maybe this solution is not the best one. Could you share some knowledge on this, please? -- With Best Regards Mikhail Lischuk -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120519/6d28bfe0/attachment.htm>
The way I accomplish this is by having an active/passive cluster. The two or more servers have individual IP addresses and running heartbeat creates a clustered IP address. The active server uses the cluster IP address. If the active server should fail then the cluster IP address moves to another server. Each handset and peer uses the clustered IP address to communicate to the server. This way all devices only communicate to a single server and you don?t have the problem of having different devices connected to different servers. I have created a Wiki page based on this which may help you. http://www.klaverstyn.com.au/david/wiki/index.php?title=Cluster The wiki mentions a script file to copy files between servers to keep the data consistent. To do this more efficiently DRDB should be used but the scripts works well in my situation. From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Mikhail Lischuk Sent: Saturday, 19 May 2012 5:48 PM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Extensions routing Greetings! I've been playing around with "clustering" some Asterisk servers for sake of fail-over and load balancing with DNS round-robin, and came to one problem. If I have, say, 2 servers, and clients register either on 1 or 2, how can I route extensions between them? I mean, if today user with extension 101 is registered on server1, and tomorrow he will register with server2 - how would any of servers know where to route it? As some examples, if I have only 2 servers, things are not so bad. I can use Dial(SIP/101&SIP/server2/101) on server1 and vice versa. OR, I can check the hungup code, and if it's 34 (or whatever I get when I try to dial unavailable peer) - try it on another server. But I guess things get tricky when you have 3 or more servers, and besides maybe this solution is not the best one. Could you share some knowledge on this, please? -- With Best Regards Mikhail Lischuk<mailto:mlischuk at itx.com.ua> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120519/082822bf/attachment.htm>
On Saturday 19 May 2012, Mikhail Lischuk wrote:> I've been playing around with "clustering" some > Asterisk servers for sake of fail-over and load balancing with DNS > round-robin, and came to one problem. > > If I have, say, 2 servers, and > clients register either on 1 or 2, how can I route extensions between > them? I mean, if today user with extension 101 is registered on > server1, and tomorrow he will register with server2 - how would any > of servers know where to route it?Won't Dundi serve your purpose? From http://www.dundi.com/ : DUNDi? is a peer-to-peer system for locating Internet gateways to telephony services. Unlike traditional centralized services (such as the remarkably simple and concise ENUM standard), DUNDi is fully-distributed with no centralized authority whatsoever. DUNDi is not itself a Voice-over IP signaling or media protocol. Instead, it publishes routes which are in turn accessed via industry standard protocols such as IAX?, SIP and H.323. DUNDi can be used within an enterprise to create a fully-federated PBX with no central point of failure, and the ability to arbitrarily add new extensions, gateways and other resources to a trusted web of communication servers, where any adds, moves, changes, failures or new routes are automatically absorbed within the cloud with no additional configuration. Regards, -- Raj -- Raj Mathur || raju at kandalaya.org || GPG: http://otheronepercent.blogspot.com || http://kandalaya.org || CC68 It is the mind that moves || http://schizoid.in || D17F