NAME
          irDisconnect - disconnect a call

     SYNOPSIS
          #include <irapi.h>

          int irDisconnect (channel_id cid, int tag);

     DESCRIPTION
          The irDisconnect function disconnects the call between the
          called/calling party and the IRAPI application for cid.  For
          Tip/Ring (T/R) channels, this amounts to putting the phone
          onhook.  The channel is moved from the IRD_ACTIVE to the
          IRD_INACTIVE service state.  Depending on the telephony
          type, the service state may go through various intermediate
          states before getting to the IRD_INACTIVE service state.

          A disconnect is performed automatically if irDeinit(3IRAPI)
          or irReturn(3IRAPI) is called without first calling
          irDisconnect, but an IRE_DISCONNECT_DONE is generated only
          if irDisconnect is called directly by the application.

     EVENT
          After the call has been successfully disconnected, the
          IRE_DISCONNECT_DONE event is generated with the appropriate
          success/failure modifier.  While the channel awaits this
          event, it temporarily is placed in the IRS_DISCONNECTING
          library state.  Applications should wait for the
          IRE_DISCONNECT_DONE rather than checking for the
          IRS_DISCONNECTING library state.

     RETURN VALUE
          IRR_OK is returned if the dial request is successfully ini-
          tiated.

          IRR_FAIL is returned if an error occurs.

     ERROR
          irError is set as follows if an error occurs:

          IRER_BADSTATE if the channel is not in the IRS_IDLE library
          state

          IRER_INVALID if the cid is invalid

          IRER_DRIVER_ERROR if a driver call failure occurs (see
          irSysError for additional information)

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

          IRER_SERVICESTATE if the channel was not initially in the
          IRD_ACTIVE or IRD_RINGING service state

     SEE ALSO
          irDeinit(3IRAPI), irReturn(3IRAPI), irServiceState(3IRAPI)

     VERSION
          This is version 8/31/00 of this man page.