User guide
August 2001 67
Handling Incoming and Outgoing Calls
If your end disconnects first, RHT_DISCONNECT waits for the
other party to disconnect for a time specified by
RDG_REMOTE_TIMEOUT, which is usually infinite.
However, the CO the other party is connected to usually times
out in one to four minutes if the other party does not disconnect.
When it times out, the CO transmits a disconnect signal on its
own. If the CO does not have a timer, it does not transmit a
disconnect and your application must wait for the other party to
hang up.
If RHT_DISCONNECT does not return within a few seconds, it
is probably because the other party has not hung up rather than
a problem with the application. Call RHT_GET_STATUS to see
the signaling bits currently present on the line if you think the
function is taking too long to return. For most protocols, if the A
and B bits are both 1, the other party has not yet hung up. When
the line is idle, both bits are usually set to 0.
The reason RHT_DISCONNECT waits for a disconnect before
returning is so the application knows when the line is free. If
RHT_DISCONNECT returned immediately, the application
would not know when the line could be used for new calls. The
application would have to call RHT_WAIT_IDLE to monitor the
line for disconnect after RHT_DISCONNECT returns.
You can change RDG_REMOTE_IDLE_TIMEOUT to be less
than infinite, but this does not free the line any faster. If
RHT_DISCONNECT does not receive the disconnect signal
within a time specified by RDG_REMOTE_IDLE_TIMEOUT,
the function returns an error and the application resumes
executing. However, the application cannot make or receive
another call until the line is idle, so you do not gain anything by
regaining control. Any exclusive line functions also return an
error until the line becomes idle. The only way the application
knows then the line becomes free is by calling
RHT_WAIT_IDLE. This function returns when the line
becomes idle, and the application can proceed. Since
RHT_WAIT_IDLE is built into RHT_DISCONNECT, it is most
efficient to wait for RHT_DISCONNECT to detect the idle and
return.