User guide

112 RealCT Direct API Developer Guide
Chapter 4: E1 Networking
RHT_WAIT_LINE_ON automatically sends any
acknowledgments required by the protocol, which serves two
purposes:
First, it isolates the application from the protocol. You can
communicate with different carriers simply by switching
protocol files rather than making changes to the
application.
Second, it improves timing. In a heavily loaded system,
threads and processes can be preempted at almost any
time, and it might take several seconds before they can run
again. If there were separate functions to detect the call
and send the acknowledgment, the two signals could be
several seconds apart. This delay might exceed the
maximum allowed by the originating end.
If the application calls RHT_WAIT_LINE_ON when the line is
in a state other than idle, the function returns an error.
RHT_WAIT_LINE_ON should continuously wait for a call, even
though you can limit the function’s run time with the
MDP_WAIT_LINE_ON_TIMEOUT parameter. If you use this
timeout to monitor for other conditions, you could miss incoming
calls. Use another thread to do any necessary monitoring. To
terminate RHT_WAIT_LINE_ON, use RHT_STOP. The
application is notified that the function terminated and will
take any appropriate action.