[OpenSIPS-Devel] [opensips] dispatcher module PVAR(9) algorithm and send() function (#604)

Răzvan Crainea notifications at github.com
Wed Sep 16 10:03:10 CEST 2015


The purpose of the dispatcher 9th algorithm is to allow you to load balance destinations based on any indices you want. For example, if you want to balance them based on their load (how many calls it has), you can do something like this:

```
modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")
...
# new call in script
ds_select_domain("0", "9");
# $dd contains the selected destination - we have to increase the load
update_stat("load_$rd", "+1");
```

>  but I also find the parameter of this function is mandatory and can not be missed

the destination in `send(destination)` is indeed a variable field that does not support pseudo-variables, so you can't use this function.

However, you can use the `forward()`[1] function, that sends the message to the message to the `$rd` in a stateless mode.

[1] http://www.opensips.org/Documentation/Script-CoreFunctions-2-1#toc18

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/604#issuecomment-140661073
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150916/de83df74/attachment-0001.htm>


More information about the Devel mailing list