Hi,

I'm using the configuration found in Onsip.org about the call forwarding feature of ser. But it's is not working, well i just did the blind call forwarding feature. The logs says that there is no avp's loaded whenever I call the username that has active call forwarding.

here is the log:
4(30396) parse_headers: flags=4
4(30396) DEBUG:avpops:store_avps: 0 avps were stored
4(30396) lookup(): '810014' Not found in usrloc
4(30396) is_user_in(): User is in group 'vmail'
4(30396) parse_headers: flags=-1
4(30396) check_via_address(202.84.24.34, 202.84.24.34, 0)
4(30396) DEBUG: t_newtran: msg id=2 , global msg id=0 , T on entrance=0xffffffff
4(30396) parse_headers: flags=-1
4(30396) parse_headers: flags=60
4(30396) t_lookup_request: start searching: hash=42336, isACK=0
4(30396) DEBUG: proceeding to pre-RFC3261 transaction matching
4(30396) DEBUG: t_lookup_request: no transaction found
4(30396) DBG: trans=0x422c14e0, callback type 1, id 0 entered
4(30396) parse_headers: flags=44
4(30396) DEBUG: noisy_timer set for accounting


Considering that my user is in the usr_preference tables with record:

uuid= <no entry>
username= 810014
domain= <no entry>
attribute= callfwd
value= sip:103@<mydomain.com>
type= 3
modified= 00000000000

here is my ser.cfg:

debug=8
fork=yes
log_stderror=yes

listen=202.x.x.x
port=5060
children=4

dns=no
rev_dns=no


fifo="/tmp/ser_fifo"
fifo_db_url="mysql://ser:heslo@localhost/ser"


#load module part

loadmodule "/usr/local/lib/ser/modules/mysql.so"
loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
loadmodule "/usr/local/lib/ser/modules/auth.so"
#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/uri.so"
loadmodule "/usr/local/lib/ser/modules/uri_db.so"
loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
loadmodule "/usr/local/lib/ser/modules/permissions.so"
loadmodule "/usr/local/lib/ser/modules/avpops.so"
loadmodule "/usr/local/lib/ser/modules/group.so"
loadmodule "/usr/local/lib/ser/modules/auth_radius.so"



#module parameter setup

modparam("rr", "enable_full_lr", 1)
modparam("auth_db|uri_db|usrloc|domain|permissions|group", "db_url", "mysql://ser:heslo@localhost/ser")
#modparam("auth_db", "calculate_ha1", 1)
#modparam("auth_db", "password_column", "password")
modparam("usrloc", "db_mode", 1)
modparam("usrloc", "use_domain", 0)

modparam("nathelper", "rtpproxy_disable", 1)
modparam("nathelper", "natping_interval", 0)

modparam("mediaproxy", "natping_interval", 30)
modparam("mediaproxy", "mediaproxy_socket", "/var/run/proxydispatcher.sock")
#modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy.sock")
modparam("mediaproxy", "sip_asymmetrics", "/usr/local/etc/ser/sip-clients")
modparam("mediaproxy", "rtp_asymmetrics", "/usr/local/etc/ser/rtp-clients")
modparam("registrar", "nat_flag", 6)
modparam("registrar", "use_domain", 0)

modparam("acc", "log_level", 2)
modparam("acc", "log_fmt", "cdfimorstup")
modparam("acc", "report_ack", 1)
modparam("acc", "failed_transactions", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 3)
modparam("acc", "db_url", "mysql://ser:heslo@localhost/ser")

modparam("acc|auth_radius", "radius_config", "/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("acc|auth_radius", "service_type", 15)
modparam("acc", "radius_flag", 4)
modparam("acc", "radius_missed_flag", 3)
modparam("acc", "failed_transactions", 1)
modparam("acc", "report_ack", 0)

modparam("uri_db", "uri_table", "uri")
modparam("uri_db", "uri_user_column", "username")
modparam("uri_db", "uri_domain_column", "domain")
modparam("uri_db", "use_domain", 1)
modparam("uri_db", "use_uri_table", 1)
modparam("uri_db", "subscriber_domain_column", "domain")
modparam("uri_db", "subscriber_user_column", "username")
modparam("uri_db", "subscriber_table", "subscriber")
modparam("uri_db", "uri_uriuser_column", "uri_user")

modparam("domain", "db_mode", 1)
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")

modparam("permissions", "default_allow_file", "/usr/local/etc/ser/allow.permissions")
modparam("permissions", "default_deny_file", "/usr/local/etc/ser/deny.permissions")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")

modparam("avpops", "avp_url", "mysql://ser:heslo@localhost/ser")
modparam("avpops", "avp_table", "usr_preferences" )

modparam("tm","fr_inv_timer", 27)
modparam("tm", "fr_inv_timer_avp", "inv_timeout")

modparam("group", "table", "grp")
modparam("group", "user_column", "username")
modparam("group", "domain_column", "domain")
modparam("group", "group_column", "grp")
modparam("group", "use_domain", 1)

modparam("registrar", "desc_time_order", 1)
modparam("registrar", "max_contacts", 1)
modparam("registrar", "retry_after", 30)

#our routing logic

route {

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483", "Too many hops");
break;
};

if (msg:len > max_len) {
sl_send_reply("513", "Message overflow");
break;
};



###record route####

if (method=="INVITE" && client_nat_test("3")) {
record_route_preset("202.x.x.x:5060;nat=yes");
} else if (method!="REGISTER") {
record_route();
};

###call tear down section###
if (method=="BYE" || method=="CANCEL") {
end_media_session();
};


###accounting###

if ((!has_totag() && (method=="INVITE" || method=="ACK")) || (method=="BYE")) {
setflag(1);
setflag(4);
};

###loose route###

if (loose_route()) {

if (has_totag() && (method=="INVITE" || method=="ACK")) {
if (client_nat_test("3") || search("^Route:.*;nat=yes")) {
setflag(6);
use_media_proxy();
};
};

route(1);
break;
};

###call type processing###


if (!is_uri_host_local()) {
if (is_from_local() || allow_trusted()) {
route(4);
route(1);
} else {
sl_send_reply("403","Forbidden");
};
break;
};

if (method=="CANCEL") {
# route(1);
route(3);
break;
} else if (method=="INVITE" || method=="BYE") {
route(3);
break;
} else if (method=="REGISTER") {
route(2);
break;
};


lookup("aliases");
if (uri!=myself) {
route(4);
route(1);
break;
};

if (!lookup("location")) {
sl_send_reply("404", "User not found");
break;
};

route(1);
}

##Default message handler##
route[1] {

t_on_reply("1");

if (!t_relay()) {

if (method=="INVITE" || method=="ACK") {
end_media_session();
};

sl_reply_error();
};
}

##Register message handler##
route[2] {

sl_send_reply("100", "Trying");

if (lookup("location")) {
sl_send_reply ("404", "Somebody already logged in with your username");
break;
};

if (!search("^Contact:\ +\*") && client_nat_test("7")) {
setflag(6);
fix_nated_register();
force_rport();
};

if (!radius_www_authorize("")) {
www_challenge("","0");
break;
};

consume_credentials();

if (!save("location")) {
sl_reply_error();
};
}

##INVITE message Handler##
route[3]
{

if (!allow_trusted()) {

if (!radius_proxy_authorize("")) {
proxy_challenge("", "0");
break;
};

consume_credentials();
};

if (is_user_in("From","pstn")) {
setflag(19);
}

if (!allow_trusted() && client_nat_test("3")) {
setflag(7);
force_rport();
fix_nated_contact();
};

lookup("aliases");
if (uri!=myself) {
route(4);
route(1);
break;
};

if (uri=~"^sip:22[0-9]*@") {
strip(2);
prefix("u");
rewritehost("61.14.130.162");
append_branch();
t_relay();
break;
}


if (uri=~"^sip:00[0-9]*@") { #pstn bound calls
strip(2); #remove the leading "00"
if (!isflagset(19)) { #check if user has credits
sl_send_reply("403","Forbidden"); #drop him if none
break; #stop executing script
};
log(1,"pstn call!");
route(4);
route(5);
break;
};

if (avp_db_store("$to/username","s:callfwd")) {
setflag(22);
avp_pushto("$ruri","s:callfwd");
route(6);
break;
};

if (!lookup("location")) {
if (is_user_in("Request-URI","vmail")) {
route(7);
break;
};
if (uri=~"^sip:[0-9]{10}@") {
route(4);
route(5);
break;
};
sl_send_reply("404", "User not found");
break;
};


route(4);
route(1);
}

###NAT traversal section###
route[4] {
if (isflagset(6) || isflagset(7)) {
if (!isflagset(8)) {
setflag(8);
use_media_proxy();
};
};
}

###PSTN Handler###
route[5] {
rewritehost("202.x.x.x");
avp_write("i:45", "inv_timeout");
route(4);
route(1);
}

###Call forwarding handler###

route[6] {

lookup("aliases");
if (uri!=myself) {

if (!isflagset(22)) {
append_branch();
};

route(4);
route(1);
break;
};
if (!lookup("location")) {
sl_send_reply("404", "User not found");
};

route(4);
route(1);
}

###voicemail Handler###
route[7] {
sl_send_reply("100", "Trying");
revert_uri();
rewritehost("202.x.x.x");
append_branch();
t_relay();
break;
}

onreply_route[1] {

if (isflagset(6) || isflagset(7) && (status=~"(180)|(183)|2[0-9][0-9]")) {

if (!search("^Content-Length:\ +0")) {
use_media_proxy();
};
};

if (client_nat_test("1")) {
fix_nated_contact();
};

}


please help,
Thanks,

Ryan

Ryan Pagquil
Infodyne Inc. (www.philonline.com)
Tel. (632)-6870715