Hi All,
I am trying to setup Kamailio to allow me to have multiple different domains (and IPs) treated as one. I am using the domain module for this. As an example I have:
* A handset registered to Kamailio by IP address. * A SIP trunk between Asterisk and Kamilio using an FQDN that uses SRV records for redundancy on Asterisk's side.
I have added all domains and IPs under the same "domain identifier". It seems the "old" domain module now uid_domain had this capability of a single virtual domain, but is this possible with the more current domain.so module? From what I've said the uid_* modules older modules from the SIP Router project, and should be replaced by more recent Kamailio modules?
- https://www.kamailio.org/docs/modules/5.0.x/modules/uid_domain.html VS. - https://kamailio.org/docs/modules/5.1.x/modules/domain.html
MariaDB [kamailio]> select * from domain;
+----+------------------------------------+------------+---------------------+
| id | domain | did | last_modified |
+----+------------------------------------+------------+---------------------+
| 1 | 12.34.56.53 | vocalpoint | 2000-01-01 00:00:01 |
| 2 | 23.34.56.54 | vocalpoint | 2000-01-01 00:00:01 |
| 3 | sbc.foo | vocalpoint | 2000-01-01 00:00:01 |
| 4 | sbc.nsw.foo | vocalpoint | 2000-01-01 00:00:01 |
| 5 | sbc.vic.foo | vocalpoint | 2000-01-01 00:00:01 |
| 6 | sbc.foo2 | vocalpoint | 2000-01-01 00:00:01 |
| 7 | sbc.nsw.foo2 | vocalpoint | 2000-01-01 00:00:01 |
| 8 | sbc.vic.foo2 | vocalpoint | 2000-01-01 00:00:01 |
+----+------------------------------------+------------+---------------------+
8 rows in set (0.000 sec)
I managed to get registrations working by hardcoding a static realm in the config, but when when usrloc does a lookup on a handset, Kamailio can't find user@sbc.nsw.foo and Kamailio returns 404.
It looks like this is because in the locations table it is listed with a domain of 12.34.56.53 (because the handset is registered by IP).
How should this work normally? Or is it even possible?
Thanks,
Rhys.
HI All,
Just to add I've also tried adding multiple alias= definitions, but have the same issue - kamailio says "user@fqdn" not found in usrloc when doing lookup(). Maybe I need to modify my lookup() call to use a hardcoded URI? But I haven't seen any examples where this was required for multidomain setups.
Would really appreciate some guidance as I'm quite stuck on this.
Thanks! Rhys.
On Tue, May 14, 2019 at 11:58 AM Rhys Hanrahan rhys.hanrahan@gmail.com wrote:
Hi All,
I am trying to setup Kamailio to allow me to have multiple different domains (and IPs) treated as one. I am using the domain module for this. As an example I have:
- A handset registered to Kamailio by IP address.
- A SIP trunk between Asterisk and Kamilio using an FQDN that uses SRV
records for redundancy on Asterisk's side.
I have added all domains and IPs under the same "domain identifier". It seems the "old" domain module now uid_domain had this capability of a single virtual domain, but is this possible with the more current domain.so module? From what I've said the uid_* modules older modules from the SIP Router project, and should be replaced by more recent Kamailio modules?
VS.
MariaDB [kamailio]> select * from domain;
+----+------------------------------------+------------+---------------------+
| id | domain | did | last_modified |
+----+------------------------------------+------------+---------------------+
| 1 | 12.34.56.53 | vocalpoint | 2000-01-01 00:00:01 |
| 2 | 23.34.56.54 | vocalpoint | 2000-01-01 00:00:01 |
| 3 | sbc.foo | vocalpoint | 2000-01-01 00:00:01 |
| 4 | sbc.nsw.foo | vocalpoint | 2000-01-01 00:00:01 |
| 5 | sbc.vic.foo | vocalpoint | 2000-01-01 00:00:01 |
| 6 | sbc.foo2 | vocalpoint | 2000-01-01 00:00:01 |
| 7 | sbc.nsw.foo2 | vocalpoint | 2000-01-01 00:00:01 |
| 8 | sbc.vic.foo2 | vocalpoint | 2000-01-01 00:00:01 |
+----+------------------------------------+------------+---------------------+
8 rows in set (0.000 sec)
I managed to get registrations working by hardcoding a static realm in the config, but when when usrloc does a lookup on a handset, Kamailio can't find user@sbc.nsw.foo and Kamailio returns 404.
It looks like this is because in the locations table it is listed with a domain of 12.34.56.53 (because the handset is registered by IP).
How should this work normally? Or is it even possible?
Thanks,
Rhys.
On Wed, May 15, 2019 at 09:38:29PM +1000, Rhys Hanrahan wrote:
Just to add I've also tried adding multiple alias= definitions, but have the same issue - kamailio says "user@fqdn" not found in usrloc when doing lookup(). Maybe I need to modify my lookup() call to use a hardcoded URI? But I haven't seen any examples where this was required for multidomain setups.
Would really appreciate some guidance as I'm quite stuck on this.
That is what I do.
You can use the 3rd parameter to save() https://www.kamailio.org/docs/modules/5.2.x/modules/registrar.html#registrar... to harmonize on save: save("location","0x00","sip:$au@you.domain.tld")
For REGISTERs and INVITEs you can check for specific allowed $rd and rewrite $rd to whatever you use for save().
if(is_method("INVITE|REGISTER")) { if($rd=="foo" || $rd=="bar") { $rd="foo"; } } else { send_reply("503","you got the wrong server"); }
Hi Daniel,
Thanks for this, much appreciated. Was worried this approach was too much of a hack and not the right approach - but knowing someone else has gone this way gives me confidence it's a reasonable solution. Will try this out tomorrow.
Thank you.
Rhys.
On Wed, May 15, 2019 at 10:32 PM Daniel Tryba d.tryba@pocos.nl wrote:
On Wed, May 15, 2019 at 09:38:29PM +1000, Rhys Hanrahan wrote:
Just to add I've also tried adding multiple alias= definitions, but have the same issue - kamailio says "user@fqdn" not found in usrloc when
doing
lookup(). Maybe I need to modify my lookup() call to use a hardcoded URI? But I haven't seen any examples where this was required for multidomain setups.
Would really appreciate some guidance as I'm quite stuck on this.
That is what I do.
You can use the 3rd parameter to save()
https://www.kamailio.org/docs/modules/5.2.x/modules/registrar.html#registrar... to harmonize on save: save("location","0x00","sip:$au@you.domain.tld")
For REGISTERs and INVITEs you can check for specific allowed $rd and rewrite $rd to whatever you use for save().
if(is_method("INVITE|REGISTER")) { if($rd=="foo" || $rd=="bar") { $rd="foo"; } } else { send_reply("503","you got the wrong server"); }
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Thu, May 16, 2019 at 12:37:50AM +1000, Rhys Hanrahan wrote:
Hi Daniel,
Thanks for this, much appreciated. Was worried this approach was too much of a hack and not the right approach - but knowing someone else has gone this way gives me confidence it's a reasonable solution. Will try this out tomorrow.
There is a minor type in my mail:
you have to change the domain in the R-URI ($rd) before calling lookup() since that function uses the R-URI.