(Page 6 of 80 in this chapter)


adiBlockCalls

Description

Blocks incoming calls.

Prototype

DWORD adiBlockCalls( CTAHD ctahd )

ctahd Context handle returned by adiOpenPort.

Return Values

Events

Details

This function causes the port attached to the specified context to enter the call control state ADI_CC_STATE_BLOCKING, which blocks both incoming and outgoing calls. adiBlockCalls may be invoked from any call control state. An active call on the port attached to the specified context will complete normally before the blocking command takes effect.

AG Access generates an ADIEVN_CALLS_BLOCKED event when the port enters the blocking state. If the port is in the ADI_CC_STATE_IDLE call control state when the function is invoked, the port immediately enters the blocking state; otherwise, the blocked event is generated after the active call completes.

The blocking method is specified in the ADI_CALLCTL_PARMS blockmode field passed to adiStartProtocol. Depending upon the protocol, incoming calls are ignored by ringing forever, responded to as busy, or the actual line state is set to tell the remote end not to send calls (reverse-make-busy).

The port remains in the blocked state until the application invokes adiUnblockCalls.

Note: This function is not available when using the NOCC protocol.

See Also

adiStartProtocol, adiUnBlockCalls, adiAnswerCall, adiPlaceCall

Example


int myBlockCalls( CTAHD ctahd )
{
    ADI_EVENT event;

    if( adiBlockCalls( ctahd ) != SUCCESS )
        return MYFAILURE;

    do 
    {
        myGetEvent( &event );           /* see adiFetchAndProcess example */
        switch( event.id )
        {
            /* ... */
        }
    } while( event.id != ADIEVN_CALLS_BLOCKED );
    return SUCCESS;
}



(Page 6 of 80 in this chapter)


Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.