Openser中文网

专注于VoIP,Opensips,Kamailio等技术,QQ群:QQ群:293697898

kamailio dispatcher的重定向分发


tags:kamailio dispatcher 创建时间:2016-11-05 11:20:30

原文:http://www.6fok.com/topics/21

dispatcher 相关配置:

modparam("dispatcher", "ds_ping_interval", 10) modparam("dispatcher", "ds_probing_threshold", 3) modparam("dispatcher", "ds_probing_mode", 0) modparam("dispatcher", "ds_ping_from", "sip:keeper@proxy.com")

路由配置:

dispatch request

route[DISPATCH] {
if(ds_is_from_list()) {
    route(SIPOUT);
} else {
    #!ifdef WITH_PATH
    if(!add_path_received()) {
            xlog("add_path_received failed\n");
    }
    #!endif
    if(is_method("REGISTER")) {
            $var(server_grp) = "1";
    } else {
            $var(server_grp) = "2";
    }
    if(!ds_select_dst($var(server_grp), "0")) {
        send_reply("404", "Dispatcher: No Destionation");
        exit;
    }
    route(RELAY);
}
exit;
}   
failure_route[MANAGE_FAILURE] {
    #route(NATMANAGE);

    if (t_is_canceled()) {
            exit;
    }

# try next dst - if only transcation failure of for 500 local timeout
if(t_check_status("500") or
    (t_branch_timeout() and !t_branch_replied())) {
    ds_mark_dst("ip");
    if(ds_next_dst()) {
        route(RELAY);
        exit;
    }
}

}



如果在有疑问或需要沟通的地方,可以QQ:1354608370 或 加FreeSWITCH+Kamailio+Opensips QQ群: 293697898 沟通交流!