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.

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.

, , , , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: