Register a signaling process to receive signaling interface primitives.
The signaling interface library (libsl.a).
#include <slsigpr.h> ... SL_RET_CODE sl_register( SL_HANDLE sl_handle, int * piMsgQueueId );
This subroutine is used to create a queue for primitives sent to this process. The subroutine returns a queue identifier that can be used by the poll() system call or the select() system call if multiple input sources are needed. The queue should not be accessed directly by the signaling process, as this has unpredictable results.
Blueworx Voice Response interacts with signaling processes by sending them signaling interface primitives to control signaling.
The second argument to the sl_register() subroutine is a pointer to an int. If not NULL, then the int to which it points will be initialized to the message queue identifier for the message queue created specifically for this process. Any messages detected on the queue are primitives intended for this signaling process. The sl_receive_request() subroutine can then be called at any time, with a timeout of 0 to receive primitives without blocking. Alternatively, a signaling process could fork() and service its own device from a subprocess.
When a message is detected, or when the process wishes to block waiting for a primitive or to poll for a primitive, call the sl_receive_request() subroutine with an applicable timeout. Use 0 for poll, -1 for infinite wait, or positive for seconds. If the return is SLRC_OK then the returned primitive will be that as passed by the channel process to sl_send_request(). The signaling process should then process this primitive.