Hello Vitali,
ok.. nobody answering. or i asked something really stuped or nobody knows :)
i traced get_all_ucontacts from dlist.c from usrloc. this function supposed to give all contact that has specified flag set. and it trying to compare flag in the database with: 1074111736 in :
for (r = p->d->d_ll.first; r != NULL; r = r->d_ll.next) { for (c = r->contacts; c != NULL; c = c->next) { if (c->c.len <= 0) continue; /* * List only contacts that have all requested * flags set */ if ((c->flags & flags) != flags) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LOG(L_ERR, "Usrloc, get_all_ucontacts: flags != flags %d != %d\n", c->flags, flags); // continue; }
I am still trying to find out how it happend.. please stop me from reading sources if I forget something really important. just commenting "continue" is really bad in my opinion
Thursday, January 29, 2004, 12:07:27 PM, you wrote:
VN> Hello,
VN> I have problem with natping_interval.. it is not pinging at all and VN> look like it just doesnot aware that I have something registered
VN> I use lates table release: 0.8.12
VN> I added some more debugging in nathelper.c to timer function:
VN> DBG("DEBUG: nathelper buff != NULL\n"); VN> cp = buf; VN> while (1) { VN> memcpy(&(c.len), cp, sizeof(c.len)); VN> if (c.len == 0) { VN> LOG(L_ERR, "ERROR: nathelper::c.len == 0\n"); VN> break; VN> }
VN> and can see that it break from the loop with c.len = 0. but when i VN> look at location table in mysql there is few devices registered. VN> probably something with ul_get_all_ucontact from usrloc..
VN> please advise
VN> here is config:
VN> loadmodule "/usr/local/lib/ser/modules/sl.so" VN> loadmodule "/usr/local/lib/ser/modules/tm.so" VN> loadmodule "/usr/local/lib/ser/modules/rr.so" VN> loadmodule "/usr/local/lib/ser/modules/auth.so" VN> loadmodule "/usr/local/lib/ser/modules/auth_db.so" VN> loadmodule "/usr/local/lib/ser/modules/mysql.so" VN> loadmodule "/usr/local/lib/ser/modules/auth_mssql.so" VN> loadmodule "/usr/local/lib/ser/modules/usrloc.so" VN> loadmodule "/usr/local/lib/ser/modules/textops.so" VN> loadmodule "/usr/local/lib/ser/modules/maxfwd.so" VN> loadmodule "/usr/local/lib/ser/modules/registrar.so" VN> loadmodule "/usr/local/lib/ser/modules/nathelper.so" VN> loadmodule "/usr/local/lib/ser/modules/exec.so"
VN> modparam("nathelper", "natping_interval", 10) VN> modparam("registrar", "nat_flag", 6) VN> # modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
VN> modparam("auth_db", "db_url","sql://ser:XXX@localhost/ser") VN> modparam ("usrloc", "db_mode", 1) VN> modparam("usrloc", "use_domain", 0) VN> modparam("usrloc", "db_url", "sql://ser:XXX@localhost/ser") VN> modparam("rr", "enable_full_lr", 1)
VN> force_rport(); VN> fix_nated_contact(); VN> setflag(6); # Mark as natted all clients
VN> if (!(method=="REGISTER")) record_route(); # 1=loose routing VN> # loose-route processing VN> if (loose_route()) { VN> log(1, "LOOSE ROUTE\n"); VN> t_relay(); VN> break; VN> }; VN> if(!uri==myself) { VN> log(1, "URI!=myself"); VN> t_relay(); VN> break; VN> };
VN> if (method=="REGISTER") { VN> log(1, "REGISTER REQUEST RECEIVED\n"); VN> if (!mssql_authorize("209.227.183.21", "subscriber")) { VN> log(1, "AUTH FAILED, REQUESTED\n"); VN> www_challenge("", "1"); VN> break; VN> }; VN> log(1, "AUTH OK, REGISTER\n"); VN> save("location"); VN> break; VN> };
VN> .....