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.
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
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
Here are the blocks of code of the dispatcher parameters and where the function ds_load_update() is being used:
#!ifdef WITH_LOADBALANCE
#Parameters using Dispatcher from DB
# ----------
modparam("dispatcher", "db_url", DBURL)
modparam("dispatcher", "table_name", "dispatcher")
# ----------
#Enabling failover mechanism
# -----------
modparam("dispatcher", "flags", 2)
# -----------
#Setting dispatcher parameters in AVP
# -----------
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
# -----------
#Setting dispatcher result in PV variables
# -----------
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
# -----------
#Enabling dispatcher algorithm according to call loads
# -----------
modparam("dispatcher", "ds_hash_size",8)
modparam("dispatcher", "ds_hash_expire", 3600)
modparam("dispatcher", "ds_hash_initexpire", 60)
# -----------
# Setting parameters for probing dispatcher destinations
# -----------
modparam("dispatcher", "ds_ping_interval", 20)
modparam("dispatcher", "ds_ping_from", "sip:kamailio1@<Kamailio IP>")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_probing_threshhold", 2)
modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")
# -----------
...
...
...
onreply_route[MANAGE_REPLY] {
#!ifdef WITH_LOADBALANCE
if(is_method("INVITE")) {
if(status=~"2[0-9][0-9]") {
xlog("L_ERROR","UBICAR setting ds_load_update requesturi=$ru from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr rcode=$rs");
ds_load_update();
}else if(status=~"[3-7][0-9][0-9]") {
ds_load_unset();
}
}
#!endif
if(status=~"[12][0-9][0-9]"){
route(NATMANAGE);
This is what i am getting from logs after the 2 call legs conversation completes: