(Page 7 of 12 in this chapter) Version
mgcReleaseBuffer
Description
- Releases a memory buffer associated with an MGCP service event.
Prototype
- DWORD mgcReleaseBuffer (CTAHD ctahd,
char buffer)
- ctahd Context handle associated with the gateway application.
- buffer Pointer to a buffer allocated by the MGCP service.
Return Values
Events
Details
- Invoke mgcReleaseBuffer to release buffers used by the MGCP service. For example, applications must invoke mgcReleaseBuffer to free the data buffers associated with the following events:
- MGCEVN_EVENT_SIGNAL_OFF_REQUEST
- MGCEVN_EVENT_EVENT_ON_REQUEST
- MGCEVN_EVENT_EVENT_OFF_REQUEST
- Failing to release buffers can cause the MGCP service to run out of memory over time. Using released buffers after calling mgcReleaseBuffer can produce unexpected results.
Example
// If an MGC Event had a non-null event.buffer:
// Release the buffer in the event structure
// NOTE! Application must be done with the contents of the buffer!
if (event.buffer != NULL)
{
ret = mgcReleaseBuffer (GWctahd, event.buffer);
// GWctahd = CTA Handle returned from ctaCreateContext
// for the application
if (ret != SUCCESS)
{
printf ("mgcReleaseBuffer returned error 0x%x\n", ret);
}
}
(Page 7 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.