[asterisk-users] Passive wait in dialplan?
Yaroslav Panych
panych.y at gmail.com
Wed Oct 5 03:35:55 CDT 2011
Hello, everyone
Here part of my dialplan context
[globals]
CMD_NOOP=0
CMD_DOSTUFF1=1
CMD_DOSTUFF2=2
CMD_DOSTUFF3=2
[blah-context]
same => n,Set(COMMAND=${CMD_NOOP})
same => n,UserEvent(blah-event,CHANNEL:${CHANNEL(name)}
same => n(COMMAND_SWITCH),GoToIf($["${COMMAND}"="${CMD_DOSTUFF1}"]?LBL_DO_STUFF1)
same => n,GoToIf($["${COMMAND}"="${CMD_DOSTUFF2}"]?LBL_DO_STUFF2)
same => n,GoToIf($["${COMMAND}"="${CMD_DOSTUFF3}"]?LBL_DO_STUFF3)
same => n,Wait(0.2)
same => n,GoTo(COMMAND_SWITCH)
same => n,NoOp(--- NOT REACHED ---)
UserEvent sends blah-event via AMI to high-level UI, user makes
decision and issues some command via Action:SetVar, then dialplan
continues to work.
The problem is, in dialplan there is an active wait loop, i.e. waiting
mechanism which rapidly checks some var(consuming processor resources
and flooding logs). Is it possible to create passive waiting loop
within current abilities of Asterisk 1.8?
regards, Yaroslav
More information about the asterisk-users
mailing list