# SER and Asterisk - Loadbalancing

**URL:** <https://community.asterisk.org/t/ser-and-asterisk-loadbalancing/23979>\
**Category:** Asterisk Support\
**Created:** [November 7, 2008, 5:20pm UTC](https://community.asterisk.org/t/ser-and-asterisk-loadbalancing/23979 "2008-11-07T17:20:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![g2010](https://avatars.discourse-cdn.com/v4/letter/g/dfb087/32.png) [@g2010](https://community.asterisk.org/u/g2010)\
**Post date:** [November 7, 2008, 5:20pm UTC](https://community.asterisk.org/t/ser-and-asterisk-loadbalancing/23979/1 "2008-11-07T17:20:10Z")

</div>

I have a question for anyone out there with information regarding load balancing inbound calls using SER.

What I am looking to do is have a ‘farm’ of 10 asterisk servers which will process inbound IVR calls. I want to set up a single device which my provider will send the initial INVITE request to. I want that device to basically just forward the INVITE request to one of my 10 asterisk servers. After the invite is forwarded i simply want the initial device to step out of the SIP and Media path. It would look something like this

GATEWAY —\> INVITE —\> Load Balancer —\> INVITE --\> Asterisk Server

while the response would look like (load balancer out of path)

Asterisk Server —\> TRYING —\> GATEWAY

I am currently acheiving this goal using a Foundry ServerIron 4G which provides SIP loadbalancing, but I want to make the switch to something i have more control over.

Does it sound like SER or OpenSER is a good fit for this?

Thanks,  
G

---

<div class="post-metadata">

**Author:** ![davevg](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@davevg](https://community.asterisk.org/u/davevg)\
**Post date:** [November 8, 2008, 1:10pm UTC](https://community.asterisk.org/t/ser-and-asterisk-loadbalancing/23979/2 "2008-11-08T13:10:12Z")

</div>

Yes, I believe any of the sip proxy’s you mentioned would work. They don’t need to be in the media path if you have public IP’s.

Here is a link to the OpenSIPS documentation on the dispatcher module (It even has an example config).  
[opensips.org/html/docs/modul … tcher.html](http://www.opensips.org/html/docs/modules/devel/dispatcher.html)

---

<div class="post-metadata">

**Author:** ![g2010](https://avatars.discourse-cdn.com/v4/letter/g/dfb087/32.png) [@g2010](https://community.asterisk.org/u/g2010)\
**Post date:** [November 8, 2008, 6:37pm UTC](https://community.asterisk.org/t/ser-and-asterisk-loadbalancing/23979/3 "2008-11-08T18:37:39Z")

</div>

Thanks for the reply. I have public IP space, so I shouldn’t have any problem taking the OpenSIPS device out of the media stream.

Moving along to my next question… is there a mechanism in SIP to take the server which forwarded the initial INVITE out of the route? For example, I would like my asterisk server to finish the transaction directly with the gateway, instead of having to route everything through the OpenSIPS server. Would look something like this

Gateway --\> INVITE --\> OpenSIPS --\> INVITE --\> Asterisk  
Asterisk --\> OK --\> Gateway  
Gateway --\> BYE --\> Asterisk

(obviously that transaction is simplified greatly, but you get the point)

thanks,  
G
