On Fri, Feb 29, 2008 at 2:01 AM, Ron <ron at silverbackasp.com>
wrote:> Hi All,
>
> If i have this kind of setup, what do i need to make it's load
balance.
>
> [ asterisk 1 ] -- [ asterisk 2 ] -- [ asterisk 3 ] -- [ asterisk 4 ]
> | | | |
> ---------------------------------------------------------------------
> | mysql cluster |
> ---------------------------------------------------------------------
>
> I plan on doing it via DNS SRV only, but if a user register on asterisk
> 1 how can users at asterisk 4 reach that user. Thank You
>
> Regards,
> Ron
>
Hi Ron,
If you're using realtime each Asterisk server will know where every
user is irrespective of which Asterisk server they registered on. The
problem is NAT, if a client is behind NAT and registers on server 1
then server's 2,3 & 4 are unlikely to be able to get through to it.
Last time I lookedthe Asterisk realtime engine doesn't record which
server an account registered on in the database so the only option I
can think of would be to forward an incoming call for a user to all 4
of your Asterisk servers that way the call will get through but if
they are not behind NAT they'll get 4 incoming calls.
Bascially it's messy using the set up you've got. What you really need
is a SIP Proxy (assuming you're using SIP, if not it's even trickier).
The SIP Proxy could load balance requests across your Asterisk
servers. For calls destined for your users you can use the
outboundproxy field in the sippeers table, by setting it to the IP
address of your SIP Proxy server you can get Asterisk to forward all
requests for a SIP account through the proxy (there is also an
outboundproxyport setting but avoid it as it's been broken forever).
There are a few gotchas with a SIP Proxy the main one being transfers.
But if you can get away with not allowing transfers then you are best
to do so as the CDR's Asterisk produces are wrong anyway.
Regards,
Greyman.