[OpenSIPS-Users] Multi-domain issues

Paris Stamatopoulos mobius at realize.gr
Tue Apr 13 10:30:47 CEST 2010


Hello Bodgan,

Well I guess you are right but I am trying to cover all holes here. Thank you very much for your help! 

Regards,
Paris

-----Original Message-----
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
Sent: Monday, April 12, 2010 6:59 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] Multi-domain issues

Hi Paris,

as long as you use SIP domains, a client has no reason for placing an IP 
in RURI - it is bogus, it must use the SIP domain.

Anyhow, as fixup, your approach is correct (with the below scripting) ->


If( $rd == '192.168.1.1' ) {

$rd = "domain.com";

}

Regards,
Bogdan

Paris Stamatopoulos wrote:
>
> Hello again,
>
> I just wanted to mention that obviously if I were to add:
>
> If( $rd =~ '192.168.1.1|domain.com' ) {
>
> $rd = "domain.com";
>
> }
>
> Just before I do the lookup() it works.
>
> However, I am not sure if this is the correct way to do so.
>
> Regards,
>
> Paris
>
> *From:* users-bounces at lists.opensips.org 
> [mailto:users-bounces at lists.opensips.org] *On Behalf Of *Paris 
> Stamatopoulos
> *Sent:* Friday, April 09, 2010 1:14 PM
> *To:* users at lists.opensips.org
> *Subject:* [OpenSIPS-Users] Multi-domain issues
>
> 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
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro


_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list