51. GotoIfTime()

Verzweigt bedingt, abhängig von Zeit und Tag.

GotoIfTime(Zeit,Wochentag,Monatstag,Monat?[[Context,]Extension,]Prio)

Verzweigt zu der angegebenen Priorität, falls die aktuelle Zeit in das angegebene Muster fällt. Jedes Element kann auch als * (für immer) oder als Spanne (mit -) definiert werden.

Die Parameter zu dieser Anwendung sind:

Uhrzeit-Spanne
Zeitintervall, im 24-Stunden-Format mit Minuten, z.B. 9:00-17:00
Wochentag
Wochentage (mon, tue, wed, thu, fri, sat, sun), z.B. mon-fri
Monatstag
Tag des Monats (1-31), z.B. 1-15
Monat
Monate (jan, feb, mar, apr, mai, jun, jul, aug, sep, oct, nov, dec), z.B. apr-oct
; Während der Öffnungszeiten zum Context incoming-geoeffnet springen.
; Wir haben montags-freitags von 9 bis 18 Uhr geöffnet:
exten => s,1,GotoIfTime(09:00-17:59,mon-fri,*,*?incoming-geoeffnet,s,1)
; außerdem samstags von 9 bis 12:
exten => s,n,GotoIfTime(09:00-11:59,sat,*,*?incoming-geoeffnet,s,1)
; Außerhalb der Öffnungszeiten zum Context incoming-geschlossen:
exten => s,n,Goto(incoming-geschlossen,s,1)
[Anmerkung]Anmerkung

Interner Hilfetext zu dieser Applikation in Asterisk 1.4: 

  -= Info about application 'GotoIfTime' =- 

[Synopsis]
Conditional Goto based on the current time

[Description]
  GotoIfTime(<times>|<weekdays>|<mdays>|<months>?[[context|]exten|]priority):
This application will have the calling channel jump to the specified location
in the dialplan if the current time matches the given time specification.

Differenz zum internen Hilfetext in Asterisk 1.2: 

9,10c9,12
< This application will have the calling channel jump to the specified location
< in the dialplan if the current time matches the given time specification.
---
> This application will have the calling channel jump to the speicified location
> int the dialplan if the current time matches the given time specification.
> Further information on the time specification can be found in examples
> illustrating how to do time-based context includes in the dialplan.

Siehe auch. Abschnitt 50, „GotoIf(), Abschnitt 37, „ExecIfTime(), Abschnitt 28, „IFTIME()


Asterisk Schulung

2.1 Beta-Version!

2.1 Beta-Version des Asterisk Buches. Die 1.0 stabile Version ist ebenfalls online. Bitte melden Sie Fehler und Feedback per E-Mail an den Autor.

YouTube Screencasts

Kostenlose Asterisk Screencasts mit jeweils 10 minütigen Erklärungen zu Spezial-Themen.

Shameless Plug

noch-ne-auto-seite.de

Das gedruckte Buch

Werbung

Asterisk-Tag.org 2008

Auf der Asterisk-Tag.org Webseite finden Sie die Folien und Videos der Vorträge.