Multi tenancy questions

Hi Guys,

I’m developing a multi tenant PBX using Asterisk 1.6 and was after a bit of advice.

At the moment I’m setting up each company in thier own context and there’s an AGI script to route incoming calls to the proper context based on incoming number. All extensions and SIP peers are stored in Realtime.

I’ve come to a problem where I’m not sure how to add an additional context without running a reload on the asterisk server. For instance, if you wanted to add an additional company e.g. Company_b I would need to add a context such as

[company_b] switch => Realtime
Even though the extensions are in the database, Asterisk won’t use the new context until it’s been added to extensions.conf and been reloaded.

Can anyone suggest a workaround to add whole contexts in realtime? If there’s a better way to attack the problem I’d love to hear a new approach

Thanks
-Matt