Starting from Asterisk 1.6 GotoIfTime application supports Timezone parameter:
[Syntax]
GotoIfTime(times,weekdays,mdays,months[,timezone]?[labeliftrue][:labeliffalse])
I setup a system that receives calls from people in different timezones so I need to use Timezone parameter in GotoIfTime Asterisk application. Surprisingly I could not find examples on Asterisk’s website so I had to search for some.
There can be two possible formats: you can specify timezone as a shift relative to the time the Asterisk operates in, or you can specify as a path to respective timezone file. Here are the examples:
GotoIfTime with Timezone relative
1 2 3 4 5 6 7 |
exten => _7266X,1,answer same => n,set(tz=${EXTEN:4}) same => n,gotoiftime(9:00-18:00,,,,+${tz}?true:false) same => n(true),noop(TRUE) same => n,hangup same => n(false),noop(FALSE) same => n,hangup |
GotoIfTime with Timezone names
1 2 3 4 5 6 7 |
same = n,GotoIfTime(8:30-17:00,mon-thu,*,*,/usr/share/zoneinfo/Europe/London?helpdeskopen,1) same = n,GotoIfTime(8:30-16:00,fri,*,*,/usr/share/zoneinfo/Europe/London?helpdeskopen,1) same = n,Verbose(1, "Helpdesk is in night mode") same = n,Playback(duty-manager-details) exten = helpdeskopen,1,Verbose(1, "Helpdesk is in day mode") same = n,Playback(pls-wait-connect-call) |
Check path to timezone files in your system. it may be different.
Good luck!