I have a scenario where I’d like to provision several businesses on Asterisk. I would also like to be able to do things like provide per user number blocking. I’m aware of contexts in Asterisk, but it does not seem that contexts are adequate to do this.
Take this for example:
include => local
include => local
include => c_user1
include => c_user2
exten => _1900X,1,Answer
exten => _1900X,Playback(not-authorised)
exten => _1900X,Hangup
This is about the best I can come up with and it doesn’t work. I have blocked 1900 numbers for user1, and that works fine.
However, for all users to be able to call all other users, at some point I have to include them in some global area (ie local). When I do that user2 gets access to user1’s dial plan, and of course user2 suddenly gets his 1900 numbers blocked as well.
This is unless of course I am missing something with Asterisk and contexts.
I saw a few people asking about the possibility of running multiple instances of Asterisk on the same system. People generally thought they where crazy and asked why that would want to do such a thing. “Thats what contexts are for” they said.
I have tried it and it seems to work well. We’re only using Asterisk for processing SIP calls so I can’t see there being an issue of contention over hardware. The root directory of asterisk can be configured from the Makefile, and everthing installs nicely under that (except for music on hold which required a mod to the conf file). For my own testing, I put each instance under /home/asterisk-N and each instance was owned by a separate user. Each user had $HOME:/usr/sbin in their path so that they ran their own asterisk binary and when I execute ‘asterisk -r’ it knows what asterisk server to connect to for that user.
I seen articles about setting up v-servers for use with Asterisk. I don’t see why you need it. I think it would just add unecessary overhead.
A big question remains of how many instances of asterisk can be run on a given hardware platform. 10? 50? The asterisk process itself doesn’t seem to take much memory, and you can strip out some of the unecessary modules so that they don’t load. Aterisk Business Edition is supposedly able to handle either 120 or 250 simultaneous calls, keeping in mind that Asterisk acts as a B2BUA and is involved in all the calls from INVITE to BYE. Admittedly that’s on a single instance. I think it very possible that you would hit the 250 simultaneous user limit before you hit the limitation of running many asterisk instances.
One problem that arose would be what would you do if user-A wanted to reach user-B, but they where provisioned on different instances of Asterisk? They wouldn’t know about each other and would supposedly have to go out to the PSTN and back in again. I think a combination of ENUM would handle this very nicely. When asterisk can’t find the number in it’s own dial plan, it forwards the SIP packet to SER. SER does an ENUM lookup and determines the host, port and protocol where that user can be reached, and forwards the SIP packet again.
We have our phones registering directly with Asterisk as well. If there where multiple instances of Asterisk running on the same platform, they’d all need to be running on different port numbers. Couldn’t have them ALL on port 5060. That’s easy. You just configure each Asterisk instance with a different server port number, and then do NAPTR/SRV lookups on your phones. Each business/set of phones probably would have to have it’s own DNS sub-domain however (to get different port numbers). Something like companyA.phones.voip.com and companyB.phones.voip.com.
So… any thoughts? It sure would be easier if Asterisk just allowed all this to be done through contexts!!
doug at pobox.com