[OpenSIPS-Users] Multi-domain issues
Paris Stamatopoulos
mobius at realize.gr
Fri Apr 9 12:14:00 CEST 2010
Hello everyone,
I am having a problem with multi-domain support on OpenSIPS. I've enabled it everywhere as mentioned on the documentation. I have created an SRV record for my domain say, 'domain.com' and added 'domain.com' on the domain table in the database. As long as the user registers at 'domain.com' everything works. If the user tries to register directly to the IP say '192.168.1.1' the registration fails.
I thought that the auto_aliases should make '192.168.1.1' an alias of 'domain.com' thus serving requests arriving to that domain as well. However from what I've seen so far the alias=, auto_aliases=yes directives does not have any effect. I've also tried adding the 192.168.1.1 and domain.com as domains in the database, however I realized that subscriber table could only use one domain at a time (so making it impossible to register both at 192.168.1.1 and domain.com)
In order to bypass this I changed my configuration in a couple of points to change the domain accordingly like:
if( $rd =~ "192.168.1.1|domain.com" ) {
if( !www_authorize("domain.com", "subscriber") ) {
www_challenge("domain.com", "0");
exit;
}
} else {
if( !www_authorize("", "subscriber") ) {
www_challenge("", "0");
exit;
}
}
Same concept in proxy_authenticate() portion of the configuration.
Now a new issue occurred. All calls arriving to OpenSIPS come from an asterisk server which has a peer configured with host=192.168.1.1 while asterisk runs at 192.168.1.2. When the call arrives it goes through the usrloc module to verify if the user is registered as such:
if (!lookup("location","m")) {
switch ($retcode) {
case -1:
case -3:
t_newtran();
t_reply("404", "Not Found");
exit;
case -2:
sl_send_reply("405", "Method Not Allowed");
exit;
}
}
However, if a user is registered at `domain.com` because asterisk sends the INVITE as user at 192.168.1.1<mailto:user at 192.168.1.1> the lookup fails and OpenSIPS returns 404.
I am pretty sure I am doing something wrong. Could someone please give me a clue on how to solve this predicament?
Regards,
Paris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100409/809c87aa/attachment.htm
More information about the Users
mailing list