Copyright © 2004 FhG FOKUS
list_file
(string)force_dst
(int)ds_select_dst(set, alg)
ds_select_dst
usageThis modules implements a dispatcher for destination addresses. It computes hashes over parts of the request and selects an address from a destination set. The selected address is used then as outbound proxy.
The module can be used as a stateless load balancer, having no guarantee of fair distribution.
The following libraries or applications must be installed before running OpenSER with this module:
none.
list_file
(string)Path to the file with destination sets.
Default value is "/etc/ser/dispatcher.list" or "/usr/local/etc/ser/dispatcher.list".
force_dst
(int)If set to 1, force overwriting of destination address when that is already set.
Default value is "0".
ds_select_dst(set, alg)
The method selects a destination from addresses set.
Meaning of the parameters is as follows:
set - the id of the set from where to pick up destination address. It is the first column in destination list file.
alg - the algorithm used to select the destination address.
"0" - hash over callid
"1" - hash over from uri.
"X" - if the algorithm is not implemented, the first entry in set is chosen.
Each destination point must be on one line. First token is the set id and next is destination address. The set id must be an integer value. Destination address must be a valid SIP URI. Empty lines or lines starting with "#" are ignored.
Next picture displays a sample usage of dispatcher.
Example 1-5. OpenSER config script - sample dispatcher usage
... # $Id: dispatcher.cfg,v 1.2 2005/06/09 09:32:02 daniel Exp $ # sample config file for dispatcher module # debug=9 # debug level (cmd line: -dddddddddd) fork=no log_stderror=yes # (cmd line: -E) children=2 check_via=no # (cmd. line: -v) dns=off # (cmd. line: -r) rev_dns=off # (cmd. line: -R) port=5060 # for more info: sip_router -h # ------------------ module loading ---------------------------------- loadmodule "modules/maxfwd/maxfwd.so" loadmodule "modules/sl/sl.so" loadmodule "modules/dispatcher/dispatcher.so" # ----------------- setting module-specific parameters --------------- # -- dispatcher params -- modparam("dispatcher", "list_file", "../etc/dispatcher.list") # modparam("dispatcher", "force_dst", 1) route{ if ( !mf_process_maxfwd_header("10") ) { sl_send_reply("483","To Many Hops"); drop(); }; ds_select_dst("2", "0"); forward(); # t_relay(); } ...
There is no guarantee of that. You should do some measurements to decide what distribution algorithm fits better in your environment.
No. Dispatcher is stateless, although some distribution algorithms are designed to select same destination for subsequent requests of the same dialog (e.g., hashing the call-id).
Take a look at http://openser.org/.
First at all check if your question was already answered on one of our mailing lists:
User Mailing List - http://openser.org/mailman/listinfo/users
Developer Mailing List - http://openser.org/mailman/listinfo/devel
E-mails regarding any stable version should be sent to <users@openser.org>
and e-mail
regarding development versions or CVS snapshots should be send to <devel@openser.org>
.
If you want to keep the mail private, send it to <team@openser.org>
.
Please follow the guidelines provided at: http://openser.org/bugs