Hi,
I m using mediaproxy for NAT traversal for client
phones. I m using the following code straight out of book from ser-0.9.0 source
package, but still the natted clients are showing their internal IPs in their
AOR when I run a “serctl ul show “.
Can anyone tell me where is the problem—
route{
if (!mf_process_maxfwd_header("10")) {
if (method!="ACK") {
sl_send_reply("483", "Too many
hops");
};
break;
};
if (msg:len >= max_len) {
if (method!="ACK") {
sl_send_reply("513", "Message too
big");
};
break;
};
if (method=="REGISTER") {
if (client_nat_test("3"))
{setflag(2);force_rport();fix_contact();};
if (!www_authorize("",
"subscriber")) {www_challenge("", "0");break;}
if (!save("location"))
{sl_reply_error();};
break;
};
if (method=="INVITE") {
if (!(is_from_local() || is_uri_host_local()))
{sl_send_reply("403", "Relaying is forbidden");break;};
t_on_failure("1");
} else if (method == "BYE" || method ==
"CANCEL") {end_media_session();};
if (loose_route()) { if (method=="INVITE" ||
method=="ACK") {use_media_proxy();};
t_relay();
break;
};
# Force subsequent messages to pass trough this proxy
if (method == "INVITE") {record_route();};
if (client_nat_test("3") &&
!search("^Record-Route:")) {force_rport();fix_contact(); };
if (method=="INVITE") {
t_on_reply("1"); };
if (!lookup("location")) {
sl_send_reply("404", "User not found"); break; };
if (method=="INVITE" ||
method=="ACK") { use_media_proxy(); };
if (!t_relay()) { if (method=="INVITE" ||
method=="ACK") { end_media_session(); }; sl_reply_error();};
}
failure_route[1] {
end_media_session();
}
onreply_route[1] {
if (status=~"(183)|(2[0-9][0-9])") {
if (client_nat_test("1")) {
fix_contact(); };
use_media_proxy();
};
}
Regards,
Ashutosh Kumar
Chetu, Inc.