Time zone restriction

I need to restrict dialing by time zone to be sure not to allow any customer service calls to be placed outside of the acceptable times.

As example: I would like the first employees of the day to only be able to dial out to EST area codes, then add additional time zones as the day progresses. Then I would like to subtract the time zones avaialable at the end of the day so we don’t call too late.

I would imagine this is some type of dialplan limit with an agi doing a time variable, but I can’t find reference to such anywhere.

Anyone implement such that could give me an example?

Thanks

Assuming the USA, you could define time dependent contexts and put the different national number group code (e.g. 404 for Atlanta) into different contexts.

You would need to do this based on Asterisk’s core time zone, so, if there are any destinations that do not have daylight saving time, you would have to manually change the time dependent includes when the clocks changed.

Examples of time dependent contexts are in the sample extensions.conf.

Thanks David I will take a look into your suggestion. Yes I am US. Have you ever seen a write up on such a setup.

Hi Have a read of
voip-info.org/wiki/view/Aste … c+strftime
we use this for routing calls between the UK and Japan for a customer, based on teh time in Japan on a system based in the
UK

simple example below

exten => s,1,set(CallTime=${STRFTIME(${EPOCH},Japan,%H%M)})
exten => s,n,Wait(1) ;Playback(prompt189)
exten => s,n,set(CallDay=${STRFTIME(${EPOCH},Japan,%u)})
;
exten => s,n,GotoIf($[${CallDay} > 5]?6:10)
exten => s,n,Hangup()
;
exten => s,n,GotoIf($[${CallTime} > 0800]?8:30)
exten => s,n,Hangup()
exten => s,n,GotoIf($[${CallTime} < 2200]?25:30)
exten => s,n,Hangup()