<div dir="ltr">Hi Alberto, thanks for your reply<div><br></div><div>yeah, i am using ds_select_dst("0","10") in this case because i use setid=0 in the dispatcher table as you can see in this route block</div><div><br></div><div><div>route[TOASTERISK] {</div><div>#!ifdef WITH_LOADBALANCE</div><div>        xlog("L_INFO","UBICAR: Forwarding non-registrar requests to Asterisk \n");</div><div>         if(!ds_select_dst("0", "10")) {</div><div>                sl_send_reply("500", "Service Unavailable");</div><div>                xlog("L_ERROR","UBICAR: No destinations available for $rd \n");</div><div>                exit;</div><div>        }</div><div>        xlog("L_ERROR","UBICAR: AVP $avp(dsdstid)\n");</div><div>        xlog("L_INFO","UBICAR: Dispatching to Asterisk Box $du\n");</div><div>        t_set_fr(0,10000);</div><div>        t_on_failure("MANAGE_FAILURE");</div><div>        route(RELAY);</div><div>        exit;</div><div>#!endif</div><div>}</div></div><div><br></div><div>Also both Asterisk are responding to ping probes done by Kamailio, they are actually responding 404 but are still kept alive thanks to this param:</div><div><div><br></div><div>modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")</div></div><div><br></div><div>and the command kamctl dispatcher dump shows them with flags=AP</div><div><br></div><div><div>URI:: sip:<a href="http://192.168.10.191:5060">192.168.10.191:5060</a> flags=AP priority=0 attrs=duid=PBX2;my=pbx2;maxload=200</div><div>URI:: sip:<a href="http://192.168.10.190:5060">192.168.10.190:5060</a> flags=AP priority=0 attrs=duid=PBX1;my=pbx1;maxload=200</div></div><div><br></div><div>Also, i would like to know if there is a way to print some kind of table to see how kamailio are keeping these call loads recorded. I have been looking for it but i cannot find any way of doing it</div><div><br></div><div>Again, thank you very much for your reply </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-04 14:23 GMT-03:00 Alberto Sagredo <span dir="ltr"><<a href="mailto:alberto.sagredo@avanzada7.com" target="_blank">alberto.sagredo@avanzada7.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>Are you using <span style="color:rgb(0,0,0);background-color:rgb(254,254,238)">ds_select_dst("1", "10"); </span>somewhere ?</div><div><br></div><div>You have to check Asterisk is responding to OPTIONS as dispatcher considered UP when 200 OK from Asterisk or SIP Gateway is received.. and not if not received.</div><div><br></div><div>I have used dispatcher but not with 10 option on algo...</div><div><br></div><div>BR</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2016-04-04 8:07 GMT+02:00 TEG AMJG <span dir="ltr"><<a href="mailto:tegamjg@gmail.com" target="_blank">tegamjg@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi</div><div><br></div><div>I am new to Kamailio and i am just trying to setup a kamailio (v4.2.3) dispatcher to distribute calls to 2 asterisk using the call load distribution algorithm (alg 10). I started to test and see how all it is working and in the logs appears that the call load record it cannot be found.</div><div><br></div><div><div>- ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (call id generated by asterisk)</div></div><div><br></div><div>I am getting this error  trying a 2 call leg conversation when asterisk is creating the BYE message destinated to the callee after receiving a BYE message from the caller, and the BYE message by Asterisk reach Kamailio to then apply the ds_load_update function</div><div><br></div><div>From what i understand about ds_load_update it is that it sets the load to an specific destination if Kamailio receives a 2xx reply of an INVITE message, and removes it if Kamailio receives a BYE message based from the Call-id received in that message, where it is actually failing in my implementation at the moment</div><div><br></div><div>Here are the blocks of code of the dispatcher parameters and where the function ds_load_update() is being used:</div><div><div>#!ifdef WITH_LOADBALANCE</div><div><br></div><div>#Parameters using Dispatcher from DB</div><div># ----------</div><div>modparam("dispatcher", "db_url", DBURL)</div><div>modparam("dispatcher", "table_name", "dispatcher")</div><div># ----------</div><div><br></div><div>#Enabling failover mechanism</div><div># -----------</div><div>modparam("dispatcher", "flags", 2)</div><div># -----------</div><div><br></div><div>#Setting dispatcher parameters in AVP</div><div># -----------</div><div>modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")</div><div>modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")</div><div>modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")</div><div>modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")</div><div># -----------</div><div><br></div><div>#Setting dispatcher result in PV variables</div><div># -----------</div><div>modparam("dispatcher", "attrs_pvname", "$var(attrs)")</div><div># -----------</div><div><br></div><div><br></div><div>#Enabling dispatcher algorithm according to call loads</div><div># -----------</div><div>modparam("dispatcher", "ds_hash_size",8)</div><div>modparam("dispatcher", "ds_hash_expire", 3600)</div><div>modparam("dispatcher", "ds_hash_initexpire", 60)</div><div># -----------</div><div><br></div><div># Setting parameters for probing dispatcher destinations</div><div># -----------</div><div>modparam("dispatcher", "ds_ping_interval", 20)</div><div>modparam("dispatcher", "ds_ping_from", "sip:kamailio1@<Kamailio IP>")</div><div>modparam("dispatcher", "ds_probing_mode", 1)</div><div>modparam("dispatcher", "ds_probing_threshhold", 2)</div><div>modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")</div><div># -----------</div></div><div><br></div><div>...</div><div><div>route[WITHINDLG] {</div><div> if (has_totag()) {</div><div>  # sequential request withing a dialog should</div><div>  # take the path determined by record-routing</div><div><br></div><div>#!ifdef WITH_LOADBALANCE</div><div>        if(is_method("BYE|CANCEL")){</div><div>                xlog("L_ERROR","UBICAR BYE ds_load_update  requesturi=$ru from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr rcode=$rs\n");</div><div>                ds_load_update();</div><div>        }</div><div>#!endif</div></div><div>...</div><div>}</div><div><br></div><div>...</div><div><br></div><div><div>onreply_route[MANAGE_REPLY] {</div><div>#!ifdef WITH_LOADBALANCE</div><div>if(is_method("INVITE")) {</div><div>        if(status=~"2[0-9][0-9]") {</div><div>                xlog("L_ERROR","UBICAR setting ds_load_update  requesturi=$ru from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr rcode=$rs");</div><div>                ds_load_update();</div><div>        }else if(status=~"[3-7][0-9][0-9]") {</div><div>                ds_load_unset();</div><div>        }</div><div>}</div><div>#!endif</div><div><br></div><div>if(status=~"[12][0-9][0-9]"){</div><div>        route(NATMANAGE);</div></div><div> }</div><div>}</div><div><br></div><div><br></div><div>This is what i am getting from logs after the 2 call legs conversation completes:</div><div><br></div><div><div>kam1 /usr/sbin/kamailio[4082]: ERROR: <script>: UBICAR: FROMASTERISK <a href="mailto:70175143146f92975a5bff8876435911@192.168.10.194" target="_blank">70175143146f92975a5bff8876435911@192.168.10.194</a><br></div><div><br></div><div>kam1 /usr/sbin/kamailio[4082]: ERROR: <script>: UBICAR setting ds_load_update  requesturi=<null> from=<a href="mailto:sip%3A103@192.168.10.194" target="_blank">sip:103@192.168.10.194</a> method=INVITE callid=<a href="mailto:28d0f6e71625c9e87baec07f46167863@192.168.10.194" target="_blank">28d0f6e71625c9e87baec07f46167863@192.168.10.194</a> to=<a href="mailto:sip%3A104@192.168.10.194" target="_blank">sip:104@192.168.10.194</a> reply=2 rrcode=OK rcode=200</div><div><br></div><div>kam1 /usr/sbin/kamailio[4083]: ERROR: <script>: UBICAR setting ds_load_update  requesturi=<null> from=<a href="http://sip:103@192.168.10.194:5060" target="_blank">sip:103@192.168.10.194:5060</a> method=INVITE callid=<a href="mailto:1-3692@192.168.20.2" target="_blank">1-3692@192.168.20.2</a> to=<a href="http://sip:104@192.168.10.194:5060" target="_blank">sip:104@192.168.10.194:5060</a> reply=2 rrcode=OK rcode=200</div><div><br></div><div>kam1 /usr/sbin/kamailio[4084]: ERROR: <script>: UBICAR BYE ds_load_update  requesturi=<a href="http://sip:104@192.168.10.190:5060" target="_blank">sip:104@192.168.10.190:5060</a> from=<a href="http://sip:103@192.168.30.1:5060" target="_blank">sip:103@192.168.30.1:5060</a> method=BYE callid=<a href="mailto:1-3692@192.168.20.2" target="_blank">1-3692@192.168.20.2</a> to=<a href="http://sip:104@192.168.30.1:5060" target="_blank">sip:104@192.168.30.1:5060</a> reply=1 rrcode=<null> rcode=<null></div><div><br></div><div>kam1 /usr/sbin/kamailio[4085]: ERROR: <script>: UBICAR BYE ds_load_update  requesturi=sip:104@192.168.30.2:22523;transport=UDP from=<a href="mailto:sip%3A103@192.168.10.194" target="_blank">sip:103@192.168.10.194</a> method=BYE callid=<a href="mailto:28d0f6e71625c9e87baec07f46167863@192.168.10.194" target="_blank">28d0f6e71625c9e87baec07f46167863@192.168.10.194</a> to=<a href="mailto:sip%3A104@192.168.10.194" target="_blank">sip:104@192.168.10.194</a> reply=1 rrcode=<null> rcode=<null></div><div><br></div><div>kam1 /usr/sbin/kamailio[4085]: ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (<a href="mailto:28d0f6e71625c9e87baec07f46167863@192.168.10.194" target="_blank">28d0f6e71625c9e87baec07f46167863@192.168.10.194</a>)</div></div><div><br></div><div>Kamailio IP: 192.168.10.194</div><div><br></div><div>Asterisk IP:</div><div><br></div><div><div>+----+-------+-------------------------+-------+----------+-------------------------------+-------------+</div><div>| id | setid | destination             | flags | priority | attrs                         | description |</div><div>+----+-------+-------------------------+-------+----------+-------------------------------+-------------+</div><div>|  1 |     0 | sip:<a href="http://192.168.10.190:5060" target="_blank">192.168.10.190:5060</a> |     2 |        0 | duid=PBX1;my=pbx1;maxload=200 | pbx1        |</div><div>|  2 |     0 | sip:<a href="http://192.168.10.191:5060" target="_blank">192.168.10.191:5060</a> |     2 |        0 | duid=PBX2;my=pbx2;maxload=200 | pbx2        |</div><div>+----+-------+-------------------------+-------+----------+-------------------------------+-------------+</div></div><div><br></div><div><br></div>
</div>
<br></div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<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" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">-<br>Saludos a todos<br></div></div>
</div>