Stops a call progress analysis operation.
AG
CG
DWORD adiStopCallProgress ( CTAHD ctahd)
|
Argument |
Description |
|
ctahd |
Context handle returned by ctaCreateContext or ctaAttachContext. |
|
Return value |
Description |
|
SUCCESS |
|
|
ADIERR_INVALID_CALL_STATE |
Function not available in the current call state. |
|
CTAERR_FUNCTION_NOT_ACTIVE |
Attempt made to stop a function that was not running. |
|
CTAERR_INVALID_CTAHD |
Context handle is invalid. |
|
CTAERR_INVALID_STATE |
Function not available in the current port state. |
|
CTAERR_SVR_COMM |
Server communication error. |
|
Event |
Description |
|
ADIEVN_CP_DONE |
After the call progress analysis operation stops, the ADI service generates a DONE event with the value field set to CTA_REASON_STOPPED. |
Use adiStopCallProgress to disable the call progress analysis operation started by adiStartCallProgress. After this function is called, call progress analysis events are not reported.
Call progress analysis cannot be restarted until the DONE event is received.
int myStopCallProgress( CTAHD ctahd )
{
CTA_EVENT event;
if( adiStopCallProgress( ctahd ) != SUCCESS )
return MYFAILURE;
while( 1 )
{
myGetEvent( &event ); /* see ctaWaitEvent example */
switch( event.id )
{
case ADIEVN_CP_DONE:
if( event.value == CTA_REASON_RELEASED )
return MYDISCONNECT; /* call has been terminated */
else if( CTA_IS_ERROR( event.value ) )
return MYFAILURE; /* API error */
else
return SUCCESS; /* stopped normally */
break;
/* might include cases to handle disconnect, DTMFs, etc. */
}
}
}