Allows the application to connect to a server and await input such as voice recognition through the browser (see <voice_rec>), a call from a phone, an SMS text, etc.
Accepted values of connect="" are YES, NO and FRESH. Use connect="NO" to define long polling settings for future use. Use connect="FRESH" to discard any undelivered message that may have been cached.
If <next_node> is not defined within <long_poll connect="">, next node will be defined as the value that is returned by the long polling.
Delimited data returned by the long polling is placed into an array named long_poll_value as follows: long_poll_value[1], long_poll_value[2], long_poll_value[3], etc. In addition, the following variables may be available:
long_poll_value_type – the type of poll returned (e.g., EMAIL, SMS, VXML, etc.).
long_poll_value_data – extra data, such as a phone number if long_poll_value_type is SMS or an email address if it is EMAIL. Note: If one long polling session is interrupted by another to the same server, the first session will end and the value CHOPPED will be returned in the long_poll_value_data variable. If the first session is restarted while the second one is still underway, the second one will end and return CHOPPED in long_poll_value_data. If next_node is not defined, the application with the interrupted polling will proceed to a node named CHOPPED. Be sure to have such a node in place or to interrogate the variable long_poll_value in the node defined as next_node and handle appropriately if the value is CHOPPED.
Child of: <node name="">
Parent of: <socket_server>, <socket_port>, <continuous>, <next_node>, <error_node>, <delimiter>
See also: <voice_rec>
Examples:
<long_poll connect="YES">
<socket_server>12.34.56.78</socket_server>
<socket_port>8888</socket_port>
<continuous>NO</continuous>
<next_node>a_node</next_node>
<error_node>long_poll_error</error_node>
<delimiter>,</delimiter>
</long_poll>
To stop the long polling:
<long_poll>STOP</long_poll>
To start a long poll that was previously defined using connect="NO":
<long_poll>START</long_poll>
To restart a long poll that was originally defined using connect="NO" while discarding any undelivered message that may have been cached in the previous start:
<long_poll>STARTFRESH</long_poll>