I am configuring a small private PBX with extensions that can call each other (no ITSP involved.) What is the appropriate mechanism to use when configuring Asterisk if I want to have certain extensions be able to dial only certain other extensions?
For example: given extensions 10 through 19, I want 10 to be able to dial 12, 16, and 18, and I want it to be able to receive calls from 13-19.
I know I can make it happen by giving each extension its own context and writing up custom dial plans in extensions.conf, but I was hoping there was some more automated way to do this. Does something like that exist? Akin to an āACLā but for extensions rather than IPs?
Thanks!
I think you are being confused by talking about the originator as an extension. For Asterisk it is a device. It might not have any extension number, or it might have many.
Contexts are the right way of doing this, as they are set for the device, not the extension.
It would be unusual for a real life organisation to require a context for every originating device. Also it is likely that several extensions could be treated the same, so they could be included as a context for that whole group, into other contexts.
It would be possible to do caller ID matches, to block specific callers to a particular extension.)
Gotcha ā so āendpointā, ādeviceā, and āoriginatorā are synonyms here, right?
It would be unusual for a real life organisation to require a context for every originating device.
I do agree; the person Iām setting this up for is interested to have this much flexibility, though, so the infrastructure I build needs to be capable.
Thanks for the info!
You could create a rows in astdb containing āsourceā and ādestinationā and then use the DB function to answer the ācan source call destinationā query.
Thanks ā So the astdb is just key/value, right? (reading about it now) So I would do something like store a key of ācallmap/3612ā with value ā1ā or whatever, to indicate that 36 can call 12, and when a call comes in I can use DB_EXISTS to see if that key is present. Is that basically what you mean?
Iād put a dash between the source and destination. It helps visually separate the S and D, and if you ever have to accommodate longer numbers or alpha, youāre set. It may come in handy if you ever need to use the CUT function since it is the default delimiter.
Iād use āyesā over ā1ā because it āreads betterā and makes your intent more obvious.
family |
key |
value |
callmap |
36-12 |
yes |
callmap |
chconnor-sedwards |
yes |
1 Like