Asterisk Dialplan - Time Based Call Rule
If you want to restrict outgoing calls in asterisk for a certain time in day , use the below dialplan.
If you are using freepbx edit ”/etc/asterisk/extensions_custom.conf” and add a new context., and assign that context to the users.
1
2
3
[time-rules]
exten => _XXXX.,1,GotoIfTime(8:30-18:45|sun-thu|*|*?from-internal,${EXTEN},1)
exten => _XXXX.,n,Playback(prepaid-auth-fail)
This rule will deny users from making calls(if the number of digits higher than 4 digiits) from 6:45 PM to 8:30 AM Sunday through Thursday and whole Friday.
For more info on command GotoIfTime() visit VoIP Info.
This post is licensed under CC BY 4.0 by the author.
