[SR-Users] Kamailio and Free switch - multi tenant

Chirag Desai djchillerz at gmail.com
Tue Apr 29 02:22:43 CEST 2014

Hi all,

First time poster here.

I had a freeswitch installation configured to allow users to register with
different domains e.g.
tenantN.my domain.com

This worked fine. Users were able to call extensions in their own domain
and access their voicemail.

All tenants/domains shared the same diaplan (default).

I followed the great tutorial at

I now have my users (using different domains as above) registering to

It was a little tricky but I can now place calls between users on the same

For some reason the variable ${domain_name} (from the tutorial) seems to be
empty so I had to replace it with a channel variable (I'm not in front of
my dialplan now but it was something like ${sip_from_domain}.

Was this the right thing to do? Why does the domain_name variable not
populate with the domain of the user making the call?

Another issue I have is to do with usernames.

I want my users to have alphanumeric usernames e.g.
user1 at tenant1.example.com
user2 at tenant1.example.com

But I'd also like them to be able to have an associated extension and

E.g. user1 may be extension 1001 and mailbox 1001

user2 may be extension 1002 and mailbox 1002.

In Kamailio I've handled this by using aliasdb.

So user1.tenant1.example.com has an alias of 1001.tenant1.example.com


User2 dials 1001.

Kamailio evaluates this and determines we want user1. It passes the call to
FS with a $rU of user1. However, even though user1 is registered and
online...the call fails and diverts to voicemail - any ideas?

Also I had to hack the above so that after the alias db lookup Kamailio
sends an $rU of 1001 at tenant1...

If anyone has got FS and Kamailio running with multiple domains I would
really love some feedback on routing and dialplan configuration.

Thanks so much in advance,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140429/c0489e7b/attachment.html>

More information about the sr-users mailing list