Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] load balancing


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
ron at silverbackasp.com
Guest





PostPosted: Thu Feb 28, 2008 9:01 pm    Post subject: [asterisk-users] load balancing Reply with quote

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
Back to top
greymanvoip at gmail.com
Guest





PostPosted: Thu Feb 28, 2008 10:12 pm    Post subject: [asterisk-users] load balancing Reply with quote

On Fri, Feb 29, 2008 at 2:01 AM, Ron <ron at silverbackasp.com> wrote:
Quote:
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.
Back to top
ron at silverbackasp.com
Guest





PostPosted: Thu Feb 28, 2008 11:03 pm    Post subject: [asterisk-users] load balancing Reply with quote

Hi Greyman,

Should it look like this now? Can i use 2 SIP Proxies just to make sure
i have a backup? will that cause any problem again with regards to
calling extension to extension? Extensions will register on the asterisk
still? How about outbound calls to other SIP provider or a telcobridge,
SIP proxy will handle that also? Basically asterisk will ask SIP proxy
of everything? Will RTP stream still go thru asterisk?

Also, i plan on setting these up as a Virtual PBX for multiple offices,
which means company A can only use Trunks for A, B is for Trunk B etc
etc. Does outbound to trunks have any issues? or problem is just
basically calling extension to extension?
[other voip provider] [telcobridge] -- [pstn]
| |
--------------------------------------------------------------------
[ SIP Proxy ]
--------------------------------------------------------------------
| | | |
[ asterisk 1 ] -- [ asterisk 2 ] -- [ asterisk 3 ] -- [ asterisk 4 ]
| | | |
--------------------------------------------------------------------
| mysql cluster |
--------------------------------------------------------------------


Thanks

Regards,
Ron


Grey Man wrote:
Quote:
On Fri, Feb 29, 2008 at 2:01 AM, Ron <ron at silverbackasp.com> wrote:
Quote:
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.

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

Back to top
YEHAVI at VMS.HUJI.AC.IL
Guest





PostPosted: Thu Feb 28, 2008 11:21 pm    Post subject: [asterisk-users] load balancing Reply with quote

Quote:
Quote:
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

See the discussion a few days ago. The Asterisk server saves the value of
SYSNAME (defined in asterisk.conf) in the field REGSERVER inside MySQL.

Regards, __Yehavi:
Back to top
greymanvoip at gmail.com
Guest





PostPosted: Thu Feb 28, 2008 11:42 pm    Post subject: [asterisk-users] load balancing Reply with quote

On Fri, Feb 29, 2008 at 4:03 AM, Ron <ron at silverbackasp.com> wrote:
Quote:
Hi Greyman,

Should it look like this now? Can i use 2 SIP Proxies just to make sure
i have a backup? will that cause any problem again with regards to
calling extension to extension? Extensions will register on the asterisk
still? How about outbound calls to other SIP provider or a telcobridge,
SIP proxy will handle that also? Basically asterisk will ask SIP proxy
of everything? Will RTP stream still go thru asterisk?

Also, i plan on setting these up as a Virtual PBX for multiple offices,
which means company A can only use Trunks for A, B is for Trunk B etc
etc. Does outbound to trunks have any issues? or problem is just
basically calling extension to extension?


[other voip provider] [telcobridge] -- [pstn]
| |
--------------------------------------------------------------------
[ SIP Proxy ]
--------------------------------------------------------------------

| | | |
[ asterisk 1 ] -- [ asterisk 2 ] -- [ asterisk 3 ] -- [ asterisk 4 ]
| | | |
--------------------------------------------------------------------
| mysql cluster |
--------------------------------------------------------------------


Thanks

Regards,
Ron

Hi Ron,

Yep it starts to get tricky Smile.

There will be slight difference depending exactly on what you need to
accomplish. I work for a VoIP Proivder that provides services to users
in internet land so our set up is designed for that. If you've got
VPNs or are on a LAN things will be different.

Two SIP Proxy's are definitely a good idea, you can load balance your
users across them using DNS SRV records, DNS Round Robin, IP Load
Balancer (although then you prob should have two load balancers). If
you're just starting your build network build or only have < 1000
users the extra SIP Proxy should go to the bottom of the list. SIP
Proxy's such as OpenSER are pretty stable and don't do anywhere near
as much work as the media server. It's the fault tolerance on your
Asterisk servers that is the most critical thing. They do a lot more
work and in my experience with them (4+ years) they are a lot more
likely to crash than your SIP Proxy.

With two SIP Proxy's you have an additional problem in that now you
need to set the outboundproxy field in the Asterisk realtime database
to the value of the proxy the user agent came through. Asterisk can't
do that for you (as far as I know) so you could possibly use the SIP
Proxy to do registrations or use a custom SIP Registrar. Both are a
good idea as they take registration load away from Asterisk and this
can be VERY significant as your user base grows. We use a custom SIP
Registrar.

For outbound trunking we go directly from Asterisk to the terminating
gateway no SIP Proxy involved. For inbound trunking we do go through
the SIP Proxy for the same reason you get users to. Incoming calls are
going to be more reliable if they are not tied to a single Asterisk
server (I guess you could use SRV records for your Asterisk servers
for inbound trunking as well but then you're kind of duplicating the
role of the SIP proxy).

The RTP stream will always be between the users and Asterisk the SIP
Proxy is never invovled. If you send an RTP packet to a SIP Proxy and
it will just shake its head in an irritated manner and ignore you.

Regards,

Greyman.
Back to top
greymanvoip at gmail.com
Guest





PostPosted: Thu Feb 28, 2008 11:51 pm    Post subject: [asterisk-users] load balancing Reply with quote

On Fri, 29 Feb 2008 6:21 +0200, Yehavi Bourvine +972-8-9489444
<YEHAVI at vms.huji.ac.il> wrote:
Quote:

See the discussion a few days ago. The Asterisk server saves the value of
SYSNAME (defined in asterisk.conf) in the field REGSERVER inside MySQL.

Regards, __Yehavi:

Ahh that's handy. That would allow a half way solution between
multiple Asterisk servers and a SIP Proxy by utilising an AGI script
or database lookup in each Asterisk server's dialplan. When the
incoming calls arrive you'll be able to know which Asterisk server to
forward them to. You still have the problems about failing over the
Asterisk servers and putting two Asterisk servers in the media path is
always best avoided if possible although probably not a huge deal.

Actually from memory there is something in sip.conf regarding
autoregexten or something where when a SIP account registers with
Asterisk it automatically adds an entry to the dialplan. If this were
employed you could forward a call to all 4 Asterisk servers and only
the one that had the registered user would forward the call.

There are lots of ways to skin the cat but the SIP Proxy is the best
way to utilise mutliple Asterisk servers when being used for SIP
calls.

Regards,

Greyman.
Back to top
kjcsb at xnet.co.nz
Guest





PostPosted: Fri Mar 07, 2008 12:16 pm    Post subject: [asterisk-users] load balancing Reply with quote

Quote:

For outbound trunking we go directly from Asterisk to the terminating
gateway no SIP Proxy involved. For inbound trunking we do go through
the SIP Proxy for the same reason you get users to. Incoming calls are
going to be more reliable if they are not tied to a single Asterisk
server (I guess you could use SRV records for your Asterisk servers
for inbound trunking as well but then you're kind of duplicating the
role of the SIP proxy).

How do you decide which Asterisk server to send the inbound call to? If the
Asterisk server that the user is registered on goes down what happens to the
inbound call?

Have you considered having the SIP clients register with the SIP proxy
rather than Asterisk or is that too difficult to get working?

Regards

Cameron
Back to top
kjcsb at xnet.co.nz
Guest





PostPosted: Fri Mar 07, 2008 12:19 pm    Post subject: [asterisk-users] load balancing Reply with quote

Quote:

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.

What is the transfer problem? Is it the Asterisk native type using
features.conf or the SIP type using REFER that causes problems?

Cameron
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services