NAME

irDeinit - deinitialize a channel

SYNOPSIS

#include <irapi.h>

int irDeinit (channel_id cid, int tag);

DESCRIPTION

The irDeinit function deinitializes a channel identified by the channel identifier cid.

Effects of irDeinit include:

  1. the channel service state is set to IRD_INACTIVE
  2. any voice processing or telephony functions are stopped immediately
  3. reserved resources are freed
  4. any pending resource requests are cancelled
  5. any calls in progress are aborted

Outstanding events can not be obtained after irDeinit is issued. Therefore applications should not deinitialize a channel before they are completely done with the channel.

NOTE: The cid must not be used after calling this function. The channel will no longer be controlled by this application.

tag is returned to the application with the subsequent IRE_DEINIT_DONE.

EVENT

If set for notification, via irSetEvent(3IRAPI), the event IRE_DEINIT_DONE is generated when the channel is released. Waiting for IRE_DEINIT_DONE ensures that the channel is released cleanly.

NOTE: The event IRE_DEINIT_DONE is not generated by default. Applications must call:

(void) irSetEvent(cid, IRE_DEINIT_DONE, IRF_NOTIFY);

to cause the IRE_DEINIT_DONE event to be generated. Setting this flag should be done immediately after obtaining the channel identifier cid.

RETURN VALUE

IRR_OK is returned if irDeinit is successful.

IRR_FAIL is returned if an error occurs.

ERROR

irError is set as follows if an error occurs:

IRER_INVALID if the cid is not valid

IRER_SYSERROR if a system or driver call failure occurs (see irSysError for additional information)

SEE ALSO

irInit(3IRAPI), irReturn(3IRAPI), irSetEvent(3IRAPI),

VERSION

This is version 12/12/02 of this man page.