modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "force_dst", 0) #forzado de la reescritura direccion de destino
modparam("dispatcher", "flags", 2) #banderas de funcionamiento, 2 significa "soporte para failover"
modparam("dispatcher", "dst_avp", "$avp(dsdst)")
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_interval", 5) #tiempo que transcurre antes de verificar nuevamente una salida inactiva
modparam("dispatcher", "ds_probing_threshhold", 5) #Numero de intentos antes de marcar una salida como inactiva
modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=403;code=488;class=3")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_hash_expire", 3600)
modparam("dispatcher", "ds_hash_initexpire", 60)
#loadmodule "dispatcher.so"
####### Routing Logic ########
# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
# - note: this is the same as route { ... }
request_route {
if (is_method("SUBSCRIBE")){
if (src_ip == 192.168.2.1 | src_ip == 192.168.2.2){
t_relay();
}
route(REGISTRAR);
}
if (src_ip == 192.168.2.1 | src_ip == 192.168.2.2){
t_relay();
}
else{
route(ASTERISK);
}
}
route[ASTERISK]{
ds_select_dst("1", "8");
t_relay();
exit();
}