User guide

August 2001 31
Sending and Receiving Digits
Handling R2 Digits
To send and receive R2 digits, use a similar procedure to
handling DTMF and MF digits, except use RHT_DIAL_R2 to
send R2 tones. RHT_DIAL_R2 handles all aspects of the
compelled protocol. When it returns, the application can proceed
to send or receive the next signal.
Send R2 digits in either compelled or pulse mode. In compelled
mode, RHT_DIAL_R2 sends the digit until it detects the
appropriate acknowledgment from the other end. In pulse
mode, the function sends the digit for an amount of time
specified by VPdialR2_s.Pulse, regardless of signals received
from the far end.
Before sending or receiving digits, use
RHT_SET_DIGIT_MODE to specify whether the application
detects forward or backward signals. RHT_DIAL_R2 also uses
this setting to determine which digits to send. If
RHT_SET_DIGIT_MODE specifies to detect backward signals,
then RHT_DIAL_R2 dials forward signals and vice versa.
The following steps show how to handle R2 signaling if the
application receives a call:
1. Set RHT_SET_DIGIT_MODE to
EN_R2_FORWARD.
The application receives forward signals and sends
backward signals.
2. Specify the maximum time to wait for the forward digit to
terminate using RHT_SET_GLOB.
3. Detect forward digits using RHT_TWAIT_DIGIT with a
digit count of 1 and a timeout of 15 seconds.
RHT_TWAIT_DIGIT returns when it detects a forward
digit. It clears the digit from the digit buffer.
4. Transmit the appropriate backward signal using
RHT_DIAL_R2.
If RHT_DIAL_R2 returns successfully and more signals are
expected, return to step 3.