Extensions routing

Home » Asterisk Users » Extensions routing
Asterisk Users 3 Comments

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?

3 thoughts on - Extensions routing

  • 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.

    Sent: Saturday, 19 May 2012 5:48 PM

    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?

  • 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,

  • According to description, that’s just what I need.

    Thank you for
    pointing that out, I’ve missed it.

    Raj Mathur (राज
    माथुर) писал 19.05.2012 15:32:

    purpose?