(Page 69 of 80 in this chapter)


adiStopProtocol

Description

Stops the execution of a telephony protocol.

Prototype

DWORD adiStopProtocol( CTAHD ctahd )

ctahd Context handle returned by adiOpenPort.

Return Values

Events

Details

This function stops a protocol previously started with adiStartProtocol.

You may stop the running protocol from any state. If the protocol is in the middle of a call, the call will be aborted (abnormally), the outgoing line signaling will be set to the ADI_CC_STATE_IDLE state, and the incoming signaling will be ignored.

All functions executing on the context that require being in the connected state will be automatically terminated with CTA_REASON_RELEASED.

If an orderly shutdown is required, you can block calls (adiBlockCalls), and when receipt of an ADIEVN_CALLS_BLOCKED event indicates that the context has entered the blocked state, you can then stop the protocol.

A new protocol may not be started until the DONE event is returned.

See Also

adiStartProtocol, adiBlockCalls

Example


int myStopProtocol( CTAHD ctahd )
{
    ADI_EVENT event;

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

    while( 1 )
    {
        myGetEvent( &event );           /* see adiFetchAndProcess example */

        switch( event.id )
        {
            case ADIEVN_STOPPROTOCOL_DONE:
                if( IS_ADI_ERROR( event.value ) )
                    return MYFAILURE;       /* API error */
                else
                    return SUCCESS;         /* stopped normally */
                break;
        }
    }
}




(Page 69 of 80 in this chapter)


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