My scenario is:
A SIP trunk is connected to a Kamailio server which is connected to multiple Asterisk servers locally and should load balance calls among these asterisk servers. How? There is a mysql database table inside Kamailio server which maps TO
part of sip header of incoming calls to one of asterisks' IPs.
Kamailio should read sip header and search inside database and after getting IP, forward the call to the proper asterisk server.
For example, value of To
inside incoming sip header is 123456
so kamailio does query database and finds number 123456
is inside 192.168.1.10
so call should be forwarded to server 192.168.1.10
.
I have read multiple articles and Kamailio's help from it's website but couldn't find anything related to this scenario. Does anyone know how to write the route inside kamailio.cfg?