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: [email protected] [mailto:[email protected]] 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:* [email protected] > [mailto:[email protected]] *On Behalf Of *Paris > Stamatopoulos > *Sent:* Friday, April 09, 2010 1:14 PM > *To:* [email protected] > *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 [email protected] <mailto:[email protected]> 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 > [email protected] > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > -- Bogdan-Andrei Iancu www.voice-system.ro _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
