Hi,
I am trying to force incoming calls destined for a UA behind a symmetric NAT through rtpproxy. In order to distinguish between those agents behind a NAT and those out in the open, I saved their location in two different tables upon registration. It now appears that even though I set db_mode to '1' to force usrloc to immediately write-back all data to the db, ser remembers a successful registration in the regular location tables.
A REGISTER request is immediately written into my NAT tables while the regular tables follows only a little later. When I call the UA in question ser will find the agent in my regular location table. When I manually delete the UA entry from the location table (and restart ser!) my configuration will force the rtp stream just as expected.
Can anybody enlighten my whether this is a bug or a feature? Also I would be very interested in learning how to handle UAs behind symmetric NATs or how to keep state learned at registration time.
I attached parts of my configuration hoping to clarify what I am trying to do.
Thilo
P.S.: this is ser 0.8.12
if (method=="REGISTER") { if ("header indicates symmetric NAT") { save("natlocation"); } else { save("location"); }; };
[...]
if ((method==INVITE)) { if(lookup("location")) { xlog("L_ERR", "UA found in 'location'\n"); } else { if(lookup("natlocation")) { xlog("L_ERR", "UA found in 'natlocation'\n"); force_rtp_proxy(); t_on_reply("2"); } else { sl_send_reply("404", "Not Found"); break; }; }; };
[...]
onreply_route[2] { if (status=~"2[0-9][0-9]"){ xlog("L_ERR", "forcing rtp stream back from NATed UA through localhost\n"); force_rport(); force_rtp_proxy(); }; }