I think it would be great to extend the "dispatcher" module, to be able to dispatch among registered entries. that is, instead of a database, select an address based on the current contacts list. e.g.: Assume I have an application that registers under the name "app@iptel.org" from several physical servers. The dispatcher will allow me to load-balance among those servers, by selecting one of the registered contacts. maybe it can be added by defining a set named "contacts" for ds_select_dst.
note: it would be best if the function first find the highest q-value in those contacts, then select only among the entries with the highest value. Alternately, it can be configured so that it gives relative "weight" to entries based on their q-value.
example usage:
route{ if ( !mf_process_maxfwd_header("10") ) { sl_send_reply("483","Too Many Hops"); drop(); };
if ( method=="REGISTER" && uri= ~"app" ) { save( "servers" ); sl_send_reply( "200", "Registered ok" ); break; }; if ( lookup( "servers" ) ) { ds_select_dst("contacts", "0"); forward(uri:host, uri:port); # t_relay(); }; }
-----Original Message----- From: serdev-bounces@lists.iptel.org [mailto:serdev-bounces.at.iptel.org@serdev.at.dror.mailshell.com]On Behalf Of Daniel-Constantin Mierla Sent: Friday, August 06, 2004 14:44 To: serdev@lists.iptel.org; 'serusers@lists.iptel.org' Subject: [Serdev] dispatcher module
Hello, I wrote a tiny module "dispatcher", able to select a destination to relay the requests to from a set of addresses. It would compute hashes over parts of the request (e.g., call-id) and select an address from the destination set based on modulo function. The selected address is used then as outbound proxy. The module could be used as a stateless load balancer, but with no guarantee of fair distribution. It can be easily extended (other distribution functions), but right now I have no time -- contributors will be very welcome.
Would someone be interested in such module? If yes, I will add it to cvs very soon.
Daniel
_______________________________________________ Serdev mailing list serdev@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serdev
---------- Your email is protected by Mailshell ---------- To block spam or change delivery options: http://www.mailshell.com/control.html?a=bsw4nz4bh24sm4jnp9dk8hosnqhlnxzi
FreshAddress.com http://rd.mailshell.com/ad482 Earn up to $3 for each of your friends who signs up with Mailshell! http://rd.mailshell.com/sp5