How to set up an SER for LOTS
I recently set up an OpenSER for the LOTS architecture to work and here I am sharing some of the configuration which is useful to make it work the way we want for LOTS. BTW, I am not including all the config here in this article. Some of it is spread through other blog posts on this blog. The part I am looking at over here is the SIP Trunk and there could be several of them acting as backups for each other. Click on Read more below for more details...
We use a module called dispatcher in OpenSER which allows round robin through the trunks. What I dont like about the dispatcher module at this point was the fact that the list of gateways was in a file and not in the database. However, it was much easier to configure than the Least Cost Routing Module which apparently can be used and allows configuration of gateways in the database. The LCR module as it says does more than what I need, but in your case, could be useful instead of the Dispatcher. Anyway, 'here is config:
First you need the dispatcher.list file and the location of this file by default in the openser binary directory:
++++++++++++++++++++++++++++++++++++++++
# $Id: dispatcher.list 2 2005-06-13 16:47:24Z bogdan_iancu $
# dispatcher destination sets
#
# proxies
2 sip:127.0.0.1:5080
2 sip:127.0.0.1:5082
# gateways
1 sip:127.0.0.1:7070
1 sip:127.0.0.1:7072
1 sip:127.0.0.1:7074
++++++++++++++++++++++++++++++++++++++++
You must set the the dispatcher module config in the main openser.cfg file as follows:
++++++++++++++++++++++++++++++++++++++++
# -- dispatcher params --
# we are in fallover mode... set flag=2
modparam("dispatcher", "flags", 2 )
++++++++++++++++++++++++++++++++++++++++
In your route function which hits the call first, you must select the list of gateways from the dispatcher.list file. Note that our file above has two lists:
++++++++++++++++++++++++++++++++++++++++
ds_select_domain("1","4");
++++++++++++++++++++++++++++++++++++++++
After this, you must set the failure route:
++++++++++++++++++++++++++++++++++++++++
t_on_failure("2");
++++++++++++++++++++++++++++++++++++++++
In the failure route, you basically move forward with the list. Note that when all entries in the list are used up, you must handle the scenario:
++++++++++++++++++++++++++++++++++++++++
if( ds_next_domain() ){
t_on_failure("2");
}
++++++++++++++++++++++++++++++++++++++++
And that's it. We are done!



0 comments:
Post a Comment