[OpenSIPS-Users] 3 Questions about dispatcher module
Peter P GMX
Prometheus001 at gmx.net
Thu Jul 22 21:55:47 CEST 2010
Hello Bogdan,
thanks for this info.
Concerning Question 2 I try to find an example with opensipsctl to
disable a destination address (destination address are in the database):
opensipsctl fifo ds_set_state i 1sip:127.0.0.1:5080 # set inactive
Or am I doing wrong something here? Does this also update the database
table 'dispatcher' or is this non-persistent?
Best regards
Peter
Bogdan-Andrei Iancu schrieb:
> Hi Peter,
>
> Peter P GMX wrote:
>> 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?
>>
> yes, that is correct, but include all methods (like ACK, BYE, UPDATE,
> PRACK, REFER, etc)
>> 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?
>>
> just use the "ds_set_state" MI command to enable/disable destinations
> at runtime - see
> http://www.opensips.org/html/docs/modules/1.6.x/dispatcher.html#id262730.
>
> For more complex changes, use the "ds_reload" to reload the entire table.
>> 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?
>>
> use ds_select_domain() to get the RURI changed and simply do a
> sl_send_reply("302","Redirected"); -> RURI will be automatically
> copied as Contact in 30x reply.
>
> Regards,
> Bogdan
>> Best regards
>> Peter
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
More information about the Users
mailing list