Here is my scenario:
I'm trying to implement replication between two OpenSER boxes. These OpenSER boxes are using MediaProxy for NAT support. I'm going to call these boxes Proxy A with IP address AAA.BBB.CCC.DDD and Proxy B with IP address WWW.XXX.YYY.ZZZ. To accomplish the replication I'm using the configuration below in the REGISTER section of both scripts.
These proxies are using a common database for the auth_db, domain, uri_db and alias_db modules, and local databases for the usrloc module. The replication is working fine, I can check the records of the location tables in both local databases and they are the same; they only have different values in the socket field.
For my test I configured two UACs, UAC1 pointing to Proxy A and UAC2 pointing to Proxy B (for registering). Also, I configured an UAC3 registering on Proxy A. When UAC3 tries to call the UAC1, which is registered in Proxy A, there is no problem. However, when UAC3 tries to call UAC2, which is registered in Proxy B, UAC2 doesn't' answer. I know that because I made captures with tethereal in both proxies, and Proxy B is sending the INVITE correctly to UAC2, using the information it (Proxy B) has received from Proxy A.
It's important to mention the three UACs are behind NAT. Is there something I'm missing? I'll appreciate any help.
Thanks
Proxy A # ----------------------------------------------------------------- # REGISTER Message Handler # ----------------------------------------------------------------
if (src_ip=="WWW.XXX.YYY.ZZZ") { # REGISTER message replicated from Proxy B, save it. if (search("^Contact:.*;received=")) { setflag(6); }; save("location"); exit; };
if (client_nat_test("7")) { setflag(6); fix_nated_register(); force_rport(); #Add received parameter to Contact header fields for replication. add_rcv_param(); };
if (!www_authorize("mydomain.net","subscriber")) { www_challenge("mydomain.net","0"); exit; };
if (!check_to()) { sl_send_reply("401", "Unauthorized"); exit; };
consume_credentials();
if (!save("location")) { sl_reply_error(); };
# Replicate REGISTER message to Proxy B t_replicate("WWW.XXX.YYY.ZZZ", "5060");
Proxy B # ----------------------------------------------------------------- # REGISTER Message Handler # ----------------------------------------------------------------
if (src_ip=="AAA.BBB.CCC.YYY") { # REGISTER messages replicated from Proxy A, save it. if (search("^Contact:.*;received=")) { setflag(6); }; save("location"); exit; };
if (client_nat_test("7")) { setflag(6); fix_nated_register(); force_rport(); #Add received parameter to Contact header fields for replication. add_rcv_param(); };
if (!www_authorize("mydomain.net","subscriber")) { www_challenge("mydomain.net","0"); exit; };
if (!check_to()) { sl_send_reply("401", "Unauthorized"); exit; };
consume_credentials();
if (!save("location")) { sl_reply_error(); };
# Replicate REGISTER message to Proxy A t_replicate("AAA.BBB.CCC.YYY ", "5060");