# h324CloseChannel

Closes an existing media channel.

#### Prototype

DWORD h324CloseChannel ( MSPHD msphd, DWORD channel)

Argument | Description
msphd | MSPP handle associated with the MUX endpoint.
channel | Specifies which of the following channels to close: H324RSN_AUDIO_IN - Incoming unidirectional audio channel H324RSN_AUDIO_OUT - Outgoing unidirectional audio channel H324RSN_VIDEO - Bidirectional video channel H324RSN_VIDEO_IN – Incoming unidirectional video channel H324RSN_VIDEO_OUT – Outgoing unidirectional video channel

#### Return values

Return value | Description
SUCCESS |
CTAERR_NOT_FOUND | msphd was not found. Either h324Start was not called or h324Delete was called.
H324ERR_INTERNAL_ERROR | Internal error in the H.324M Middleware.
H324ERR_MUTEX_LOCK_FAILED | Internal error trying to lock mutex.
H324ERR_NOT_INITIALIZED | h324Initialize was not called first.

#### Events

Event | Description
H324EVN_CHANNEL_CLOSED | Either the host application or the remote terminal successfully closed a channel. The size field defines which channel was closed.
H324EVN_CHANNEL_CLOSE_FAILED | Remote terminal rejected the request to close the specified channel.

#### Example

ret = h324CloseChannel( GwConfig[nGw]. MuxEp.hd, H324RSN_VIDEO );
if( ret != SUCCESS )
{
printf("Failed to close the video logical channel...\n");
return ret;
}
ret = WaitForSpecificEvent( nGw, GwConfig[nGw]. hCtaQueueHd,
H324EVN_CHANNEL_CLOSED, &event );