Previous PageTable Of Contents../index.htmlIndexNext Page

dx_playtoneEx( )

Description | Cautions | Example | Errors | See Also

Name:

int dx_playtoneEx(chdev,tngencadp,tptp,mode)

Inputs:

int chdev

  valid Dialogic channel device handle

 

TN_GENCAD *tngencadp

  pointer to the TN_GENCAD structure

 

DV_TPT *tptp

  pointer to the DV_TPT structure

 

int mode

  asynchronous/synchronous

Returns:

0 if success

 

-1 if failure

Includes:

srllib.h

 

dxxxlib.h

Category:

Global Tone Generation

Mode:

asynchronous/synchronous

Top Of PageDescription

The dx_playtoneEx( ) function plays the cadenced tone defined by TN_GENCAD, which describes a signal by specifying the repeating elements of the signal (the cycle) and the number of desired repetitions. The cycle can contain up to 4 segments, each with its own tone definition and on/off duration, which creates the signal pattern or cadence. Each segment consists of a TN_GEN single- or dual-tone definition (frequency, amplitude and duration) followed by a corresponding off-time (silence duration) that is optional. The dx_bldtngen( ) function can be used to set up the TN_GEN components of the TN_GENCAD structure. The segments are seamlessly concatenated in ascending order to generate the signal cycle.

This function returns the same errors, return codes, and termination events as the dx_playtone( ) function. Also, the TN_GEN array in the TN_GENCAD data structure has the same requirements as the TN_GEN used by the dx_playtone( ) function.

Set termination conditions using the DV_TPT structure. This structure is pointed to by the tptp parameter.

Asynchronous Operation: To run this function asynchronously, set the mode field to EV_ASYNC. When running asynchronously, this function will return 0 to indicate that it has initiated successfully, and will generate a TDX_PLAYTONE termination event to indicate successful termination.

Synchronous Operation: By default, or by setting the mode field to EV_SYNC, this function will run synchronously, and will return a 0 to indicate successful termination of synchronous play.

For signals that specify an infinite repetition of the signal cycle (cycles = 255) or an infinite duration of a tone (tg_dur = -1), you must specify the appropriate termination conditions in the DV_TPT structure used by dx_playtoneEx( ).

After dx_playtoneEx( ) terminates, use the ATDX_TERMMSK( ) function to determine the termination reason.

Parameter

Description

chdev

specifies the valid channel device handle obtained when the channel was opened using dx_open( ).

tngencadp

points to a TN_GENCAD structure (which defines a signal by specifying a cycle and its number of repetitions), or specifies one of the following predefined, standard, PBX call progress signals:

 

CP_DIAL

  Dial Tone

 

CP_REORDER

  Reorder Tone (Paths-Busy, All-Trunks-Busy, Fast Busy)

 

CP_BUSY

  Busy Tone (Slow Busy)

 

CP_RINGBACK1

  Audible Ring Tone 1 (Ringback Tone)

 

CP_RINGBACK2

  Audible Ring Tone 2 (Slow Ringback Tone)

 

CP_RINGBACK1_
CALLWAIT

  Special Audible Ring Tone 1

 

CP_RINGBACK2_
CALLWAIT

  Special Audible Ring Tone 2

 

CP_RECALL_DIAL

  Recall Dial Tone

 

CP_INTERCEPT

  Intercept Tone

 

CP_CALLWAIT1

  Call Waiting Tone 1

 

CP_CALLWAIT2

  Call Waiting Tone 2

 

CP_BUSY_VERIFY_A

  Busy Verification Tone (Part A)

 

CP_BUSY_VERIFY_B

  Busy Verification Tone (Part B)

 

CP_EXEC_OVERRIDE

  Executive Override Tone

 

CP_FEATURE_
CONFIRM

  Confirmation Tone

 

CP_STUTTER_DIAL

  Stutter Dial Tone (same as Message Waiting Dial Tone)

 

CP_MSG_WAIT_DIAL

  Message Waiting Dial Tone (same as Stutter Dial Tone)

tptp

points to the DV_TPT data structure, which specifies one or more of the following terminating conditions for this function:

 

DX_DIGTYPE

  Digit termination for user-defined tone

 

DX_MAXDTMF

  Maximum number of digits received

 

DX_MAXSIL

  Maximum silence

 

DX_MAXNOSIL

  Maximum non-silence

 

DX_LCOFF

  Loop current off

 

DX_IDDTIME

  Inter-digit delay

 

DX_MAXTIME

  Function time

 

DX_DIGMASK

  Digit mask termination

 

DX_PMOFF

  Pattern match silence off

 

DX_PMON

  Pattern match silence on

 

DX_TONE

  Tone-off or Tone-on detection

mode

specifies whether to run this function asynchronously or synchronously. Set to one of the following:

 

EV_ASYNC

  Run the function asynchronously.

 

EV_SYNC

  Run the function synchronously (default).

Top Of PageCautions

    1. The channel must be idle when calling this function.
    2. If a TN_GEN tone generation template contains an invalid tg_dflag, or the specified amplitude or frequency is outside the valid range, dx_playtoneEx( ) will generate a TDX_ERROR event if asynchronous, or -1 if synchronous.

Top Of PageExample

Top Of PageErrors

If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:

EDX_BADPARM

  • Invalid parameter

EDX_BADPROD

  • Function not supported on this board

EDX_BADTPT

  • Invalid DV_TPT entry

EDX_BUSY

  • Busy executing I/O function

EDX_AMPLGEN

  • Invalid amplitude value in TN_GEN structure

EDX_FREQGEN

  • Invalid frequency component in TN_GEN structure

EDX_FLAGGEN

  • Invalid tg_dflag field in TN_GEN structure

EDX_SYSTEM

Top Of PageSee Also


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Dialogic Corporation
All rights reserved
This page generated February, 2002