I'm trying to set up kamailio dispatcher to
distribute calls to 2 asterisk servers. So far, the failover
case seems ok, but I cannot get the dispatcher to distribute
load. All calls are going to the last destination entry in the
dispatcher table even if I have set the maxload attributes. I'm
using algorithm 10 for load distribution. The number of calls
sent to one asterisk is well above the maxload. Hope someone
more experienced in dispatcher can review my config and give me
some recommendations. Thanks in advance.
Here is the content of dispatcher table in postgresql db.
Here are the dispatcher sections in kamailio.cfg.
# ----- dispatcher params -----
#!ifdef WITH_DISPATCHER
modparam("dispatcher", "db_url", DBASTURL)
modparam("dispatcher", "table_name", "dispatcher")
modparam("dispatcher", "force_dst", 1).
# If flag 2 is set, then failover support is enabled.
modparam("dispatcher", "flags", 3)
# the last address in destination set is used as a final
option to send the request to
modparam("dispatcher", "use_default", 1)
# load balancing fail over
modparam("dispatcher", "dst_avp", "$avp(dsdst)")
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
# PVs for hashing
modparam("dispatcher", "hash_pvar", "$fU@$ci")
# PVs to store results when calling ds_is_from_list
modparam("dispatcher", "setid_pvname", "$var(setid)")
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
# method to probe the gateways
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_threshhold", 10)
modparam("dispatcher", "ds_ping_reply_codes",
"class=2;code=403;code=404;code=484;code=488;class=3")
modparam("dispatcher", "ds_probing_mode", 1)
# size of hash table storing data for call load
dispatching, power of two
modparam("dispatcher", "ds_hash_size", 10)
# expiration time in seconds to remove the load on a
destination if no BYE was received
modparam("dispatcher", "ds_hash_expire", 3600)
# expiration time in seconds to remove the load on a
destination if no 200 OK for INVITE was received
# and state updated with ds_load_update
modparam("dispatcher", "ds_hash_initexpire", 60)
modparam("dispatcher", "ds_hash_check_interval", 30)
#!endif
......
#!ifdef WITH_DISPATCHER
failure_route[RTF_DISPATCH] {
if
(t_is_canceled()) {
exit;
}
# next
DST - only for 500 or local timeout
if
(t_check_status("500") or (t_branch_timeout() and
!t_branch_replied())) {
# mark the destination Inactive and
Probing
ds_mark_dst("IP");
# select the new destination
if(ds_next_dst())
{
t_on_failure("RTF_DISPATCH");
route(RELAY);
exit;
}
else {
# last available node failed to
reply, no other destinations available
send_reply("404", "No
destination");
exit;
}
}
}
#!endif