<p dir="ltr">Hi all,</p>
<p dir="ltr">First time poster here.</p>
<p dir="ltr">I had a freeswitch installation configured to allow users to register with different domains e.g.<br>
<a href="http://tenant1.mydomain.com">tenant1.mydomain.com</a><br>
<a href="http://tenant2.mydomain.com">tenant2.mydomain.com</a><br>
..<br>
tenantN.my <a href="http://domain.com">domain.com</a></p>
<p dir="ltr">This worked fine. Users were able to call extensions in their own domain and access their voicemail. </p>
<p dir="ltr">All tenants/domains shared the same diaplan (default).</p>
<p dir="ltr">I followed the great tutorial at <a href="http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc">http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc</a></p>
<p dir="ltr">I now have my users (using different domains as above) registering to Kamailio.</p>
<p dir="ltr">It was a little tricky but I can now place calls between users on the same domain. </p>
<p dir="ltr">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}.</p>

<p dir="ltr">Was this the right thing to do? Why does the domain_name variable not populate with the domain of the user making the call?</p>
<p dir="ltr">Another issue I have is to do with usernames.</p>
<p dir="ltr">I want my users to have alphanumeric usernames e.g. <a href="mailto:user1@tenant1.example.com">user1@tenant1.example.com</a><br>
<a href="mailto:user2@tenant1.example.com">user2@tenant1.example.com</a></p>
<p dir="ltr">But I'd also like them to be able to have an associated extension and mailbox.</p>
<p dir="ltr">E.g. user1 may be extension 1001 and mailbox 1001</p>
<p dir="ltr">user2 may be extension 1002 and mailbox 1002.</p>
<p dir="ltr">In Kamailio I've handled this by using aliasdb.</p>
<p dir="ltr">So <a href="http://user1.tenant1.example.com">user1.tenant1.example.com</a> has an alias of <a href="http://1001.tenant1.example.com">1001.tenant1.example.com</a></p>
<p dir="ltr">Scenario:</p>
<p dir="ltr">User2 dials 1001.</p>
<p dir="ltr">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?</p>

<p dir="ltr">Also I had to hack the above so that after the alias db lookup Kamailio sends an $rU of 1001@tenant1...</p>
<p dir="ltr">If anyone has got FS and Kamailio running with multiple domains I would really love some feedback on routing and dialplan configuration.</p>
<p dir="ltr">Thanks so much in advance,</p>
<p dir="ltr">CD</p>