[OpenSIPS-Users] 3 Questions about dispatcher module

Peter P GMX Prometheus001 at gmx.net
Wed Jul 21 14:59:42 CEST 2010


Hello,

we want to use the dispatcher module for a very simple load balancing
with hash over callid or round robin (we have also tried the
load-balancer module but have problems when we want to use it for
generating 302 redirects).

I have read that the dispatcher module "can be used as a stateless load
balancer, having no guarantee of fair distribution". However googling
around I have seen that nevertheless can handle
invites,progress,ringing,cancels,byes etc. correctly.

Question #1:
Can I use e.g.
  if (method=="REGISTER" || method=="INVITE" || method=="CANCEL") {
    ds_select_dst("2", "0");
    forward();
  }
for this kind of routing in order to ensure that all messages belonging
to one call are always routed to the same destination?

Question #2:
When using dispatcher with a database table for the proxies and gateways
we would like to disable certain proxies on the fly via the database by
an external application. Do we have to reload parts of OpenSIPS in order
to make the dispatcher module become aware of it? How can we do that?

Question #3:
We would like to send back "302 redirect" for Invites, which are coming
from external gateways. Thus external gateways can directly communicate
with the proxy. How can we use the information (hostname, port etc) from
"ds_select_dst" in order to send back a 302 redirect message. I know it
is somehow stored in an AVP, but I have no example how the get the host
and port part out of it. Can you provide an example?

Best regards
Peter








More information about the Users mailing list