adiStartDial

Starts the dialing function for applications that are not using protocol-independent call control.

Supported board types

Prototype

DWORD adiStartDial ( CTAHD ctahd, char *digitstr, ADI_DIAL_PARMS *parms)

Argument

Description

ctahd

Context handle returned by ctaCreateContext or ctaAttachContext.

digitstr

Pointer to string of digits to be dialed (ADI_MAX_DIGITS).

parms

Pointer to dialing parameters, stored in ADI_DIAL_PARMS structure as follows (NULL designates default values):

typedef struct
{
  WORD size;           /* size of this structure                        */
  DWORD method;        /* default dialing method: 0=DTMF, 1=pulse, 2=MF */
  DWORD breaktime;     /* duration of pulse digit break (ms)            */
  DWORD maketime;      /* duration of pulse digit make (ms)             */
  DWORD interpulse;    /* interdigit delay between pulsed digits (ms)   */
  DWORD flashtime;     /* duration of the flash-hook (ms)               */
  DWORD shortpause;    /* duration of the comma in dialing string (ms)  */
  DWORD longpause;     /* duration of the dot in dialing string (ms)    */
  INT32 dtmfampl1;     /* first dtmf amplitude (dBm)                    */
  INT32 dtmfampl2;     /* second dtmf amplitude (dBm)                   */
  DWORD dtmfontime;    /* ON duration of DTMFs (ms)                     */
  DWORD dtmfofftime;   /* OFF duration of DTMFs (ms)                    */
  DWORD dialtonewait;  /* max time to wait for dialtone (ms) on ';'     */
                       /* precise dialtone parameters:                  */
  DWORD tonefreq1;     /* frequency to detect                           */
  DWORD tonebandw1;    /* bandwidth                                     */
  DWORD tonefreq2;     /* 2nd frequency to detect (dualtone)            */
  DWORD tonebandw2;    /* 2nd bandwidth                                 */
  INT32 tonequalampl;  /* broadband qual level (in dBm)                 */
  DWORD tonequaltime;  /* qualification time (in ms)                    */
  DWORD tonereflevel;  /* reserved                                      */
  DWORD reserved;      /* reserved, must be 0                           */
  DWORD tonetotaltime; /* total time for dial tone with interruptions   */
} ADI_DIAL_PARMS;

In some instances, the dtmfofftime can increase by 20 ms.

Refer to ADI_DIAL_PARMS for field descriptions.

Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

digitstr is NULL.

CTAERR_FUNCTION_ACTIVE

Function already started.

CTAERR_INVALID_CTAHD

Context handle is invalid.

CTAERR_INVALID_STATE

Function not valid in the current port state.

CTAERR_OUTPUT_ACTIVE

Open port failed because the stream and slot are already opened on another port.

CTAERR_SVR_COMM

Server communication error.

Events

Event

Description

ADIEVN_DIAL_DONE

The reason in the value field can contain either an error or one of the following:

CTA_REASON_FINISHED

CTA_REASON_RELEASED

CTA_REASON_STOPPED

Details

For AG boards and CG boards, adiStartDial requires one or more of the following DSP files to be loaded, depending on the digitstr and related parameters:

CG boards

AG boards

Use

tone.f54

tone.m54

Generating DTMF and MF tones.

None

signal.m54

(AG 2000, AG 2000C, and AG 2000-BRI only)

Generating pulse digits.

ptf.f54

ptf.m54

Precise dial tone detection.

Use this function to start dialing for NOCC users. adiStartDial is similar to adiStartDTMF, but also allows access to pulse-dialing, flashing, and precise dial tone detection.

Note: The DTMF detector is disabled while adiStartDial is active.

digitstr can contain the following embedded escape characters that control the dialing sequence:

Character

Description

;

(semicolon) Wait for precise dial tone.

.

(period) Insert long pause in dialing.

,

(comma) Insert short pause in dialing.

!

Flash hook.

P

Switch to pulse dialing.

T

Switch to DTMF dialing.

M

Switch to MF dialing.

The following table lists the mapping to the United States MF digits for MF dialing:

Digit

United States MF name

0 to 9

Specific digit address

B

MF ST3P

C

MF STP

D

MF KP

E

MF KP2, MF ST2P

F

MF ST

NOCC users can start a call progress analysis operation (adiStartCallProgress) after receiving the DONE event.

After calling adiStartDial, expect a DONE event. If the function is dialing DTMFs, the outbound voice path must be available (not in use by another function). If the function is pulse dialing, the outbound signaling path must be available.

See also

adiStartMFDetector, adiStartProtocol, adiStopDial