Table of Contents Index NMS Glossary Previous Page Next Page (Page 58 of 69 in this chapter) Version


adiStopProtocol

Description

Stops the execution of a telephony protocol.

Prototype

DWORD adiStopProtocol ( CTAHD ctahd )

ctahd CTA context handle returned by ctaCreateContext.

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 CTA 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 CTA 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 )
{
 CTA_EVENT event;

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

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

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




Table of Contents Index NMS Glossary Previous Page Next Page (Page 58 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.