<p>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:</p>

<pre><code>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");
</code></pre>

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

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

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

<p>[1] <a href="http://www.opensips.org/Documentation/Script-CoreFunctions-2-1#toc18">http://www.opensips.org/Documentation/Script-CoreFunctions-2-1#toc18</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/604#issuecomment-140661073">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciSptAD5iPgpKoBcTI4CWfbFnpEhkks5oyRm-gaJpZM4FuUHY.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/604#issuecomment-140661073"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>