ctaRefreshParms

Resets the values of all parameters on a context to the global defaults. Global defaults are either statically defined values maintained within a process or dynamically defined values maintained by the Natural Access Server.

Prototype

DWORD ctaRefreshParms ( CTAHD ctahd)

Argument

Description

ctahd

Handle returned by ctaCreateContext.


Return values

Return value

Description

SUCCESS

 

CTAERR_INVALID_CTAHD

An invalid context handle was passed as an argument to a function, or the context was destroyed by another thread.

CTAERR_NOT_INITIALIZED

Natural Access is not initialized. Call ctaInitialize first.

CTAERR_SVR_COMM

Server communication error.


Details

ctaRefreshParms resets the values of all parameters on a context to the global defaults. Use this function if another application process updates the global defaults and the application process needs these values.

Refer to Managing parameters for more information.

See also

ctaGetParms, ctaSetEventSources

Example

#define APPEVN_REFRESH_PARMS CTA_USER_EVENT(0x1)

void DemoSendRefreshParms(CTAHD ctahd)
{
    CTA_EVENT event;

    memset( &event, 0, sizeof( event ) );

    event.id    = APPEVN_REFRESH_PARMS;
    event.ctahd = ctahd;
    
    ctaQueueEvent( &event );
}

void DemoProcessEvents(CTAQUEUEHD ctaqueuehd, CTAHD ctahd)
{
    CTA_EVENT event;

    for(;;)
    {
        ctaWaitEvent(ctaqueuehd, &event, CTA_WAIT_FOREVER); 

        switch ( event.id )
        {
        case APPEVN_REFRESH_PARMS:
            ctaRefreshParms( event.ctahd );
            break;

        case ADIEVN_CALL_DISCONNECTED:
            printf( "Caller hung up." );
            break;

        /* . . . */

        default:
            break;
        }
    }
}