Skip to Content
Asterisk: The Future of Telephony, 2nd Edition
book

Asterisk: The Future of Telephony, 2nd Edition

by Jim Van Meggelen, Jared Smith, Leif Madsen
August 2007
Intermediate to advanced
608 pages
20h 33m
English
O'Reilly Media, Inc.
Content preview from Asterisk: The Future of Telephony, 2nd Edition

Name

GotoIfTime() — Conditionally branches, depending on the time and day

Synopsis

GotoIfTime(times,days_of_week,days_of_month,months?label)

Branches to the specified extension, if the current time matches the specified time. Each of the elements may be specified either as * (for always) or as a range.

The arguments to this application are:

times

Time ranges, in 24-hour format

days_of_week

Days of the week (mon, tue, wed, thu, fri, sat, sun)

days_of_month

Days of the month (1-31)

months

Months (jan, feb, mar, apr, etc.)

; If we're open, then go to the open context
; We're open from 9am to 6pm Monday through Friday
exten => s,1,GotoIfTime(09:00-17:59,mon-fri,*,*?open,s,1)
;
; We're also late on Tuesday and Thursday
exten => s,n,GotoIfTime(09:00-19:59,tue&thru,*,*?open,s,1)
;
; We're also open from 9am to noon on Saturday
exten => s,n,GotoIfTime(09:00-11:59,sat,*,*?open,s,1)
;
; Otherwise, we're closed
exten => s,n,Goto(closed,s,1)

See Also

GotoIf(), IFTIME

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Asterisk: The Future of Telephony

Asterisk: The Future of Telephony

Jim Van Meggelen, Jared Smith, Leif Madsen
Switching to VoIP

Switching to VoIP

Theodore Wallingford

Publisher Resources

ISBN: 9780596510480Errata Page