Talk:Multiple Companies

From FreeSWITCH Wiki
Jump to: navigation, search

IRC Discussion HOWTO

This IRC conversation concisely explains what to do. It goes along with the config files displayed on the main page.

diegoviola > zoiks: I made a multi-tenant setup just a few days ago.

zoiks > diego: What was the general procedure that worked for you? I made a domain.xml file and domain dir under conf/directory and had the domain.xml say to load domain/1020.xml file but FS still reports that I must make a directory 'domain' and add a user 1020. I think I'm missing something...

diegoviola > zoiks: Copy conf/directory/default to conf/directory/your-domain and conf/directory/defautl.xml to conf/directory/yourdomain.xml and disable force-register-domain and force-register-db-domain from the profile. Once you do that, and if you want to separate each domain/tenant with it's own dialplan, you can set user_content on each user, to point it to it's own dialplan, etc. If you need one dialplan per domain you can just copy conf/dialplan/default.xml to conf/dialplan/yourdomain.xml and rename the context on it. Hope that helps.

zoiks > diego: In confi/directory/mydomain.xml there's a line near the top that says "<domain name="$${domain}"> --- must i change that to "<domain name="mydomain.com">

JafoJ > zoiks: Yes

zoiks > JafoJ: A bit lower, there's a line that says <group name="default"> -- must that become <group name="mydomain.com"> ?

JafoJ > zoiks: No

diegoviola > zoiks: One sec pls, i'm doing a pastebin of my config. This is how i achieved my multi-tenant, two domains with it's own users and dialplans, etc: http://pastie.org/635706

diegoviola > zoiks: That will give you two users on their own domain: 1000@company-a.org and 1000@company-b.org, and when you make a call, it will attempt to reach whatever extension on their own context/domain. So if you call a extension with 1000@company-a.org it will go and try to find it in the company-a.org context/dialplan.

zoiks > diego: Inside conf/directory/company-a.org/ each ext file (1020.xml, for example) must be individually edited to change the user_context to be company-a.org, right?

diegoviola > zoiks: Yeah, but i prefer to put the user_context on the domain file, so i don't have to edit each user with that line. Take a look at conf/directory/company-a.org.xml and conf/directory/company-b.org.xml and you will see that i put it there instead. I also comment user_context on each user/file, because i have already put that on the domain instead.

zoiks > diego: phat ! thank you ! I've been looking for that for literally weeks. i WILL put it into the wiki. FS is intimidating to voip newbies like me so thanks again for your HUGE HELP.