Use WaitEvent to specify a time to wait for an event to occur.
Use WaitEvent to find out when different events are posted, for example, when a caller has pressed a DTMF key, so that your state table can take appropriate action while a background record is in progress.
In addition to DTMF, WaitEvent also detects custom server channel events indicated by the Host Event edge. WaitEvent handles the custom server event and updates SV232 (System: Custom server event: name of server), SV233 (System: Custom server event: information field), and SV234 (System: Custom server event: event data) with information about the event. These system variables are updated by the custom server using the CA_Report_Channel_Event() subroutine. WaitEvent also supports silence detection during remote duplex record.
WaitEvent has one parameter.
Timeout. Specify the timeout in seconds, either as a variable or a constant. The valid range is -1 to MAXLONG/1000, where -1 means infinite timeout. (MAXLONG/1000 is 2147483647/1000 seconds, nearly 600 hours.)
WaitEvent can have one of the following results:
The event will be cleared from the queue.
The event remains in the queue, so you should transfer this call to a fax line.
The event will be cleared from the queue.
If a long silence occurs, this is usually because there is no caller responding at the end of the line, perhaps because the caller has hung up, but this is not detected by the telephony protocol. Because of this, no further voice input or output is allowed on the line and it is expected thatthe call will now be hung up. If your application wishes to continue with voice input or output after receiving this event, you may perform a short record operation to clear the event.
There was a problem with the voice channel. The application should hang up the call.
The caller has hung up. The application should now hang up the call.
When using an ASCII editor, code this action as shown below. The single parameter, either a constant or a variable, is used to specify the timeout value.
For example:
label3: "WaitEvent with 'timeout' as a variable" WaitEvent(timeout) edge EDGE_EVENT_HOST: edge EDGE_EVENT_DTMF: edge EDGE_EVENT_FAX: edge EDGE_EVENT_VOICE: edge EDGE_EVENT_LONG_SILENCE: edge EDGE_EVENT_LINE_PROBLEM: edge EDGE_HUP: edge EDGE_TIMEOUT: edge EDGE_EVENT_INVALID_TIMEOUT: ;
or,
label4: "WaitEvent with constant timeout value" WaitEvent("12345") edge EDGE_EVENT_HOST: edge EDGE_EVENT_DTMF: edge EDGE_EVENT_FAX: edge EDGE_EVENT_VOICE: edge EDGE_EVENT_LONG_SILENCE: edge EDGE_EVENT_LINE_PROBLEM: edge EDGE_HUP: edge EDGE_TIMEOUT: edge EDGE_EVENT_INVALID_TIMEOUT: ;
The parameters and edges are described above under "Parameters" and "Possible results". For more information, see Testing a state table using the debugger.