On 14/04/15 17:11, Olle E. Johansson wrote:
On 14 Apr 2015, at 17:06, Daniel Tryba d.tryba@pocos.nl wrote:
Is there an easy way to figure out on which server a uac is registered when using a shared database (modparam("usrloc", "db_mode", 3)).
When uac1 is registered on server1 (dns srv loadbalancing) and uac2 is on server2. A call from uac1 to uac2 with a simple lookup("location") will result in server1 directly trying to connect to uac2. If this device is natted (or behind a stateful firewall) this will fail.
In the location table the column socket contains the server which received the request. So if I know this value I can have server2 route the call to this value/server and have the call delivered to uac1 via an "existing connection".
The idea was to use reg_fetch_contacts to fetch this/these socket values in $ulc and in case they are not local redirect/branch to those servers. But if the value of socket isn't local the $ulc for socket is null.
I could use sqlops to fetch this manually, but is there an easier way I am missing?
Use the path header?
Upcoming major release has some embedded functionality for this case, relying on path -- iirc, was added by Charles Chance:
- http://kamailio.org/docs/modules/4.3.x/modules/registrar.html#registrar.p.pa...
Adding path can be done in config, then apply changes before doing save location for register request.
Cheers, Daniel