Thanks Sir,<div><br><div>Thats what I expected. Do you think this will change if I use only two values with huge difference in each other, lets say {26000,29000} ?</div><div><br></div><div>Regards,</div><div>Sammy<br><br><div class="gmail_quote">
On Mon, Jun 4, 2012 at 3:05 PM, Carsten Bock <span dir="ltr">&lt;<a href="mailto:carsten@ng-voice.com" target="_blank">carsten@ng-voice.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
this functionality uses a generic &quot;hash&quot; function to generate an<br>
Integer-Value of the PVAR and then reduces this to the number hosts in<br>
your destination set.<br>
If you have only using two different values of the PVAR and only two<br>
hosts in the dispatcher list, it can likely happen, that the same host<br>
is choosen. You should try a wider range of values for your PVAR...<br>
(e.g. try 1000 different values), then you should see a distribution.<br>
<br>
Carsten<br>
<br>
2012/6/4 SamyGo &lt;<a href="mailto:govoiper@gmail.com">govoiper@gmail.com</a>&gt;:<br>
<div><div class="h5">&gt; Hi,<br>
&gt;<br>
&gt; No, nothing at all. I haven&#39;t went too deep into debug logs but no internal<br>
&gt; error was appearing. Everything was as calm as ever and I only get one<br>
&gt; destination uri.<br>
&gt;<br>
&gt; So maybe what I&#39;m getting from your email is that , for this to work the way<br>
&gt; I expect is to have more unique and random values in my hash_pvar to get the<br>
&gt; required functionality.<br>
&gt;<br>
&gt; Thanks once again,<br>
&gt; BR<br>
&gt; SG<br>
&gt;<br>
&gt; On Mon, Jun 4, 2012 at 11:52 AM, Daniel-Constantin Mierla<br>
&gt; &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; do you get any errors in the log?<br>
&gt;&gt;<br>
&gt;&gt; Be aware that hash functions may return same code for different input<br>
&gt;&gt; values. A hash function is guaranteed to return same code for same  input<br>
&gt;&gt; value, but there can be collisions of codes for different values.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Daniel<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 6/3/12 3:41 PM, SamyGo wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m having trouble using algorithm 7 in dispatcher module. Here is my<br>
&gt;&gt; kamailio version. The problem is that despite multiple dispatcher entries<br>
&gt;&gt; corresponding to one set all calls go only to only one destination.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; [root@control1 ~]# kamailio -V<br>
&gt;&gt; version: kamailio 3.2.3 (x86_64/linux) 59f87e<br>
&gt;&gt; flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,<br>
&gt;&gt; DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,<br>
&gt;&gt; DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,<br>
&gt;&gt; USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES<br>
&gt;&gt; ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,<br>
&gt;&gt; MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB<br>
&gt;&gt; poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
&gt;&gt; id: 59f87e<br>
&gt;&gt; compiled on 18:04:08 Apr 19 2012 with gcc 4.1.2<br>
&gt;&gt; [root@control1 ~]#<br>
&gt;&gt;<br>
&gt;&gt; Here is the dipacther module params.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; # ------- Load-balancer params ------<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;db_url&quot;, DBURL)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;table_name&quot;, &quot;dispatcher&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;setid_col&quot;, &quot;setid&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;destination_col&quot;, &quot;destination&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;force_dst&quot;, 1)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;flags&quot;, 3)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;dst_avp&quot;, &quot;$avp(i:271)&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;cnt_avp&quot;, &quot;$avp(i:273)&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;ds_ping_from&quot;, &quot;sip:proxy@109.XXX.2XX.XX&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;ds_ping_interval&quot;,15)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;ds_probing_mode&quot;, 1)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;ds_ping_reply_codes&quot;,<br>
&gt;&gt; &quot;class=2;code=403;code=404;code=484;class=3&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;hash_pvar&quot;, &quot;$avp(i:274)&quot;)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;ds_hash_size&quot;, 9)<br>
&gt;&gt; modparam(&quot;dispatcher&quot;, &quot;ds_hash_initexpire&quot;, 60)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Below is the function call based on avp(i:274)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; avp_db_query(&quot;select uid from uid_did_map where accountcode =<br>
&gt;&gt; &#39;$fU&#39;&quot;,&quot;$avp(i:274)&quot;);<br>
&gt;&gt; xlog(&quot;L_INFO&quot;,&quot;$rm from $fu (IP:$si:$sp) ---------<br>
&gt;&gt; UID:&#39;$avp(i:274)-----------&#39;\n&quot;);<br>
&gt;&gt;         ds_load_update();<br>
&gt;&gt;         if(!ds_select_dst(&quot;1&quot;,&quot;7&quot;)) {<br>
&gt;&gt;                         sl_send_reply(&quot;500&quot;, &quot;No destination available&quot;);<br>
&gt;&gt;                         xlog(&quot;route[MAIN] : $rm : No destinations<br>
&gt;&gt; available for $rd&quot;);<br>
&gt;&gt;                         exit;<br>
&gt;&gt;         }<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m getting two different values for avp(i:274) {26,29} but the<br>
&gt;&gt; destination are not hashed on its base.<br>
&gt;&gt;<br>
&gt;&gt; Please help.<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Sammy G.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
&gt;&gt; <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
&gt;&gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
&gt;&gt; <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
&gt;&gt; Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -<br>
&gt;&gt; <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a><br>
&gt;&gt; Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -<br>
&gt;&gt; <a href="http://asipto.com/u/kpw" target="_blank">http://asipto.com/u/kpw</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
&gt; <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
&gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
</div></div>Carsten Bock<br>
CEO (Geschäftsführer)<br>
<br>
ng-voice GmbH<br>
Schomburgstr. 80<br>
D-22767 Hamburg / Germany<br>
<br>
<a href="http://www.ng-voice.com" target="_blank">http://www.ng-voice.com</a><br>
mailto:<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a><br>
<br>
Mobile <a href="tel:%2B49%20179%202021244" value="+491792021244">+49 179 2021244</a><br>
Office <a href="tel:%2B49%2040%2034927219" value="+494034927219">+49 40 34927219</a><br>
Fax <a href="tel:%2B49%2040%2034927220" value="+494034927220">+49 40 34927220</a><br>
<br>
Sitz der Gesellschaft: Hamburg<br>
Registergericht: Amtsgericht Hamburg, HRB 120189<br>
Geschäftsführer: Carsten Bock<br>
Ust-ID: DE279344284<br>
<br>
Hier finden Sie unsere handelsrechtlichen Pflichtangaben:<br>
<a href="http://www.ng-voice.com/imprint/" target="_blank">http://www.ng-voice.com/imprint/</a><br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div></div>