|
Hi ,
Iam new to openser.I have managed to configure presence module,but i get some error.I would appreciate if you could correct me(my cfg file).
debug=7 # debug level (cmd line: -dddddddddd)
log_stderror=yes
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=udp:192.168.64.10:5060
children=4
mpath="/usr/local/lib/openser/modules/"
loadmodule "mysql.so"
loadmodule "sl.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "presence.so"
loadmodule "avpops.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "mi_fifo.so"
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"
modparam("usrloc", "db_mode", 2)
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("rr", "enable_full_lr", 1)
modparam("presence|usrloc","db_url","mysql://openser:openserrw@192.168.64.10/openser")
modparam("presence","max_expires",3600)
modparam("presence","force_active",1)
modparam("presence","192.168.64.180", "3000:192.168.64.10:5060" )
modparam("mi_fifo","fifo_name", "/tmp/openser_fifo")
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
if (!method=="REGISTER")
record_route();
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
};
if (!uri==myself) {
append_hf("P-hint: outbound\r\n");
route(1);
};
if (uri==myself) {
if( is_method("PUBLISH|SUBSCRIBE"))
route(2);
if (method=="REGISTER") {
if (!www_authorize("192.168.64.10", "subscriber")) {
www_challenge("192.168.64.10", "0");
exit;
};
save("location");
exit;
};
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};
route(1);
}
route[1] {
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
exit;
}
route[2]
{
# absorb retransmissions
if (! t_newtran())
{
sl_reply_error();
exit;
};
if(is_method("PUBLISH"))
{
handle_publish();
t_release();
} else if( is_method("SUBSCRIBE")) {
handle_subscribe();
t_release();
};
exit;
} |