Giovanni,
As far as I know, you also need to edit on-reply route in your script.
It seams that you don't correct the contact header of the called party,
which is send in the 200 reply. The script would look like this:
####################################################################
INVITE routing logic is something like this
t_on_reply("1"); #in order to the replies pass to on reply block. You
should add this!
if (loose_route()) {
if (has_totag() && method=="INVITE") {
if (nat_uac_test("19")) {
setflag(6);
force_rport();
fix_nated_contact();
};
force_rtp_proxy("l");
t_on_reply("1");
};
t_relay();
break;
}
if (method=="INVITE") {
record_route();
if (nat_uac_test(19)) {
fix_nated_contact();
force_rport();
setflag(6);
}
if ( !isflagset(6) || SAME_NAT) {
t_relay();
} else {
force_rtp_proxy();
t_on_reply("1");
t_relay();
}
}
# When NAT, the 200 (Ok) reply carries the contact header where the called party is
reached. If it is
# behind NAT, we need to correct his contact.
onreply_route[1] {
if (status=~"(183)|(2[0-9][0-9])") {
if (client_nat_test("1")) {
fix_contact();
};
use_media_proxy();
};
}