Table of Contents Index NMS Glossary Previous Page Next Page (Page 9 of 12 in this chapter) Version


mgcSetEndpointServiceState

Description

Transitions one or more endpoints into service or out of service.

Prototype

DWORD mgcSetEndpointServiceState (CTAHD ctahd,
char *epname,
int inservice,
unsigned delay)

ctahd Context handle associated with the gateway application.

epname Name of the MGCP endpoint to take out of service or put into service. Use the * wild card to specify multiple endpoints.

inservice Specify whether to put the endpoint into service or take the endpoint out of service:

FALSE: Takes the endpoint(s) out of service.


TRUE: Puts the endpoint(s) into service.

delay Specifies the length of the restart delay in seconds.The effect of this argument varies based on the value specified in the inservice argument. For more information, refer to Details.

Return Values

Events

Details

Applications invoke mgcSetEndpointServiceState to put MGCP service endpoints into service or to take endpoints out of service. The inservice argument specifies whether put the endpoint in service or take the endpoint out of service.

The value specified for the inservice argument affects how the MGCP interprets the delay value. The following table describes the interaction between the inservice and delay values:
To take the following action...

Change the endpoint state to...

Specify this inservice value...

And specify this delay value...

Take the endpoint out of service immediately
(a forced restart).

Out of service

FALSE

Null

Take the endpoint out of service within the specified number of seconds (a graceful restart).

Out of service

FALSE

Number of seconds.

Put the endpoint into service immediately.

If the endpoint is in the process of being taken out of service gracefully, because of a previous call to mgcSetEndpointServiceState, the restart method is cancel-graceful and the delay argument is ignored.

In service

TRUE

Null

Put the endpoint into service in a specified number of seconds.

If the specified endpoint is in the process of being taken out of service, the restart method is restart and the endpoint goes into service in the number of seconds specified.

In service

TRUE

Number of seconds.

Example

char   epName[20]; // endpoint name
unsigned   secDelay = 0; // restart delay in seconds

strcpy(epName,"DS001");

// Set endpoint in service: RestartInProgress sent to call agent
ret = mgcSetEndpointServiceState (GWctahd , epName, TRUE, secDelay);
// GWctahd = CTA Handle returned from ctaCreateContext
// for the application
// Or set out of service (also RestartInProgress sent to call 
// agent)
// ret = mgcSetEndpointServiceState (GWctahd , epName, FALSE, secDelay);

if (ret != SUCCESS )
{  
 printf ("mgcSetEndpointServiceState %s returned error 0x%x\n", epName, ret);
 return FAILURE;
}

See Also

mgcUnregisterEndpoint



Table of Contents Index NMS Glossary Previous Page Next Page (Page 9 of 12 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, NMS Communications Corporation. All rights reserved.