Thnaks for the reply.

I don't need mhomed since i do the socket forcing by myself after the the DISPATCH selects the Gateway. What i need is something that modifies the SIP Request in order to use the outbound IP in the R-URI, To-Header, etc. I'm doing that using the $td and $rd pseudo-variables, but i'm not sure if that is the safest approach.

The TOPOS module is really usefull for this, thanks for mentioning. However, the dialog_expires parameter is really confusing, since it imposes a maximum time allowed for a dialog to exist (After the records are deleted, routing no longer works). I could work with a very long timer for this if the ended dialogs would get removed from the table automatically, but that doesn't happen. 

Cheers