(Page 35 of 69 in this chapter) Version
adiStartCallProgress
Description
- Starts monitoring call progress analysis data.
Prototype
- DWORD adiStartCallProgress ( CTAHD ctahd,
ADI_CALLPROG_PARMS *parms)
- ctahd CTA context handle returned by ctaCreateContext.
- parms Pointer to call progress analysis parameters, stored in the ADI_CALLPROG_PARMS, as follows (NULL designates default values):
typedef struct
{
DWORD size; /* Size of this structure */
DWORD timeout;
/* If no tone/voice detected, done via timeout (ms). */
DWORD busycount;
/* Number of busy cycles until report and quit; */
/* busycount ignored if precise busy detected. */
DWORD ringcount;
/* Number of ring cycles until report and quit. */
DWORD maxreorder;
/* Separates fast busy from busy (ms) */
DWORD maxbusy; /* Separates busy from ring cycle (ms) */
DWORD maxring; /* Separates ring from dial tones (ms) */
DWORD maxringperiod;
/* Maximum ring period before CP_RING_QUIT (ms) */
DWORD voicemedium;
/* Time after VOICE BEGIN until VOICE MEDIUM (ms) */
DWORD voicelong;
/* Time after VOICE BEGIN until VOICE LONG (ms) */
DWORD voicextended;
/* Time after VOICE BEGIN until VOICE EXTENDED (ms) */
DWORD silencetime;
/* Silence period after voice til VOICE END (ms) */
DWORD precqualtime; /* Precise tone qualification time (ms) */
DWORD precmask; /* Precise tone mask */
DWORD stopmask; /* mask to auto-stop adiCallProgress: */
INT32 silencelevel;
/* Reference level below which is "silence" (dBm) */
DWORD voicetoneratio; /* voice vs. tone ratio (IDUs) */
DWORD qualtonetime1;
/* Qualify time 1 for the TONE state (ms); */
DWORD qualtonetime2;
/* Qualify time 2 for the TONE state (ms); */
DWORD qualvoicetime1;
/* Qualify time 1 for the VOICE state (ms); */
DWORD qualvoicetime2;
/* Qualify time 2 for the VOICE state (ms); */
DWORD leakagetime; /* Leaky integrator time constant (in ms) */
DWORD noiselevel; /* Level window for QT2 state (in IDUs) */
} ADI_CALLPROG_PARMS;
Return Values
Events
DSP File
- For most AG hardware, this function requires that callp.dsp has been loaded. On AG 2000 boards and AG 4000/C boards, callp.m54 and ptf.m54 must be loaded to the board before adiStartCallProgress will work. On CG 6000C boards, callp.f54 and ptf.f54 must be loaded to the board before adiStartCallProgress will work. Refer to the board-specific installation and developer's manual for a table of MIPS usage for all functions.
- For QX hardware, this function is supported in the standard DSP file. Refer to the QX Installation and Developer's Manual for a table of MIPS usage for all functions.
Details
- This function starts the call progress analysis operation. This is the same functionality utilized by call control. It can be used by applications that are not using standard call control, or by any application during the connected state.
- The call progress analysis operation always terminates when any of the following events occur:
- ADIEVN_CP_BUSYTONE
- ADIEVN_CP_RORDTONE
- ADIEVN_CP_SIT
- ADIEVN_CP_NOANSWER
- ADIEVN_CP_CED
- In addition, you can configure the ADI_CALLPROG stopmask parameter to stop on occurrence of any of the following events:
- ADIEVN_CP_RINGQUIT
- ADIEVN_CP_VOICE_BEGIN
- ADIEVN_CP_VOICE_MEDIUM
- ADIEVN_CP_VOICE_LONG
- ADIEVN_CP_VOICE_EXTENDED
- ADIEVN_CP_VOICE_END
See Also
- adiStopCallProgress
Example
/* Wait for voice detection or any network tone.
* Returns SUCCESS if voice is detected within 30 seconds, else DISCONNECT.
*/
int waitforvoice( CTAHD ctahd )
{
ADI_CALLPROG_PARMS parms;
CTA_EVENT event;
DWORD last_cp_event = 0;
ctaGetParms (ctahd, ADI_CALLPROG_PARMID, &parms, sizeof parms);
parms.stopmask |= ADI_CPSTOP_ON_VOICE_BEGIN;
parms.timeout = 30000; /* Increase timeout from default 10 seconds */
if( adiStartCallProgress (ctahd, &parms) != SUCCESS )
return MYFAILURE;
do
{
myGetEvent( &event ); /* see ctaWaitEvent example */
if (ADIEVN_CP_VOICE <= event.id && event.id <= ADIEVN_CP_CED)
last_cp_event = event.id;
} while (event.id != ADIEVN_CP_DONE);
switch (event.value)
{
case CTA_REASON_FINISHED:
if (last_cp_event == ADIEVN_CP_VOICE)
return SUCCESS;
else
return MYDISCONNECT; /* hang-up tone detected */
case CTA_REASON_TIMEOUT: /* nothing detected - give up */
case CTA_REASON_RELEASED: /* The call was terminated */
case CTA_REASON_STOPPED:
default:
return MYDISCONNECT;
}
}
(Page 35 of 69 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights
reserved.