Asterisk App: GotoIfTime

Выполняет условный переход на основании текущего времени.
Conditional Goto based on the current time.

Описание

Это приложение установит определенные контекст, расширение и приоритет в структуре вызова, основанные на оценке заданного времени. После того, как приложение будет выполнено, ядро программы pbx продолжит выполнение в указанном месте диалплана. Если текущее время находится в пределах заданного времени, выполнение вызова продолжится как <labeliftrue>. В противном случае вызов будет продолжен как <labeliffalse>. Если лейбл, выбранный условием, пропущен, - переход не выполняется, а продолжается со следующей инструкции (приоритета).
Дальнейшие действия аналогичны действиям команды Asterisk app: Goto.
Дополнительную информацию можно найти в примерах, иллюстрирующих использование вложенных контекстов диалплана, базирующихся на времени.
Tango

eng

eng

This application will set the context, extension, and priority in the channel
structure based on the evaluation of the given time specification. After this
application completes, the pbx engine will continue dialplan execution at
the specified location in the dialplan. If the current time is within the
given time specification, the channel will continue at <labeliftrue>. Otherwise
the channel will continue at <labeliffalse>. If the label chosen by the
condition is omitted, no jump is performed, and execution passes to the next
instruction. If the target jump location is bogus, the same actions would
be taken as for 'Goto'. Further information on the time specification can
be found in examples illustrating how to do time-based context includes in
the dialplan.
Синтаксис
 GotoIfTime(times,weekdays,mdays,months[,timezone]?[labeliftrue][:labeliffalse])
 
Аргументы
  • labeliftrue
    • Продолжить как <labeliftrue> если условие верно. Форма записи аналогична Asterisk app: Goto - [[context,]extension,]priority.
  • labeliffalse
    • Продолжть как <labeliffalse> если условие не верно. Форма записи аналогична Asterisk app: Goto - [[context,]extension,]priority.

Пример #1: Range & Timezone

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

См. также

Asterisk GotoIf - примеры, операторы, выражения и RegExp() Asterisk app: Goto()

Команды диалплана Asterisk

  • asterisk/app/gotoiftime.txt
  • Последние изменения: 2019/01/29