<div dir="ltr">Dear users,<div><br></div><div>I&#39;m trying to figure out how this mod_distributor works. I&#39;ve a few questions to help me get this going.</div><div><br></div><div>I&#39;ve defined two of my gateways in the distributor.conf.xml like this:</div>
<div><br></div><div><div><font face="courier new, monospace">&lt;configuration name=&quot;distributor.conf&quot; description=&quot;Distributor Configuration&quot;&gt;</font></div><div><font face="courier new, monospace">  &lt;lists&gt;</font></div>
<div><font face="courier new, monospace">    &lt;list name=&quot;GWLB&quot; total-weight=&quot;2&quot;&gt;<br></font></div><div><font face="courier new, monospace">      &lt;node name=&quot;OpenSIPS-A&quot; weight=&quot;1&quot;/&gt;</font></div>
<div><font face="courier new, monospace">      &lt;node name=&quot;OpenSIPS-B&quot; weight=&quot;1&quot;/&gt;</font></div><div><font face="courier new, monospace">    &lt;/list&gt;</font></div><div><font face="courier new, monospace">  &lt;/lists&gt;</font></div>
<div><font face="courier new, monospace">&lt;/configuration&gt;</font></div></div><div><br></div><div>and so when I reload the distributor from API I get the following warning:</div><div><br></div><div><div><font face="courier new, monospace">freeswitch@internal&gt; distributor_ctl reload</font></div>
<div><font face="courier new, monospace">+ok reloaded.</font></div><div><font face="courier new, monospace">2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total weight does not add up to total weight 10</font></div>
</div><div><br></div><div>So I&#39;ve changed the total-weight to 10, and set weight of each node as 5. That gives the same warning as well.</div><div><br></div><div>A Warning is fine, but as soon as I just use API to expand the list I get a proper gateway name for the first two times only and then -err starts showing up until I reload the distributor.</div>
<div><br></div><div><div><font face="courier new, monospace">freeswitch@internal&gt; expand distributor GWLB</font></div><div><font face="courier new, monospace">OpenSIPS-A</font></div><div><font face="courier new, monospace">freeswitch@internal&gt; expand distributor GWLB</font></div>
<div><font face="courier new, monospace">OpenSIPS-B</font></div><div><font face="courier new, monospace">freeswitch@internal&gt; expand distributor GWLB</font></div><div><font face="courier new, monospace">-err</font></div>
<div><font face="courier new, monospace">freeswitch@internal&gt; expand distributor GWLB</font></div><div><font face="courier new, monospace">-err</font></div><div><font face="courier new, monospace">freeswitch@internal&gt;</font></div>
</div><div><br></div><div>The last question is regarding use of this distributor from LUA script.</div><div><br></div><div>I call in the distributor like this from my LUA.</div><div><br></div><div><div><font face="courier new, monospace">session = freeswitch.Session(&quot;{ignore_early_media=true,origination_caller_id_number=&quot;..outbound_cli..&quot;}sofia/gateway/${distributor(GWLB)}/&quot;.. phone_number);</font></div>
</div><div><br></div><div>and that gives a straight error:</div><div><br></div><div><font face="courier new, monospace">[ERR] mod_sofia.c:4668 Invalid Gateway &#39;%{distributor(GWLB)}&#39;</font><br></div><div><br></div>
<div><br></div><div>I hope somebody can share their knowledge on this module and help me move forward with my project.</div><div><br></div><div>Best Regards,</div><div>Sammy</div></div>