jonnydollar
asked on
Asterisk: How to control who call call outside office
Using asterisk how do i control what extensions call call outside and which cant
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry the database command should have been :-
database put denyexternal 1234 yes
database put denyexternal 1234 yes
You might previously have had :-
exten => _9.,1,Dial(ZAP/g1/$EXTEN:1
You could change this to :-
exten => _9.,1,Set(DENYEXT=${DB(den
exten => _9.,n,GotoIf($[ "${DENYEXT}" = "yes" ]?deny)
exten => _9.,n,Dial(ZAP/g1/$EXTEN:1
exten => _9.,n,Hangup
exten => _9.,n(deny),Answer
exten => _9.,n,Wait(1)
exten => _9.,n,Playback(externalden
exten => _9.,n,Wait(10)
exten => _9.,n,Hangup
With this alteration for every external call a lookup is performed on the internal database and if an entry exists and is set to 'yes' then that extension is denied and a message is played (you will need to record your own or use a suitable one that comes with the system).
To deny a phone which has the extension number 1234 you would enter the following line from the asterisk consode:-
database put denyext 1234 yes
The advantage with this method is that it is more universal as you dont have to muck around with contexts and you dont need to edit and reload the configuration to make a change. You could for example expand on the code to allow the phones which are denied external access to actually dial certain external numbers (emergency services for example).