NAME
          irAnswer - answer an incoming call

     SYNOPSIS
          #include <irapi.h>

          int irAnswer (channel_id cid, int tag);

     DESCRIPTION
          The irAnswer function establishes the call between the cal-
          ling party and the IRAPI application for the channel iden-
          tifier (cid).  For Tip/Ring (T/R) channels, this means tak-
          ing the phone off hook.  The channel service state is
          changed from IRD_INACTIVE or IRD_RINGING to IRD_ACTIVE.

          tag is returned to the application with the subsequent
          IRE_ANSWER_DONE.

     EVENT
          After the incoming call has been successfully answered, the
          IRE_ANSWER_DONE event is generated with the IREM_COMPLETE
          modifier.  While the cid awaits this event, it is placed in
          the IRS_ANSWERING library state.  For some telephony types,
          the IRE_ANSWER_DONE might be generated immediately without
          the need to temporarily go into the IRS_ANSWERING library
          state.

          If the cid is in the IRD_ACTIVE state when the irAnswer
          function is called, the function will return IRR_OK and an
          IRE_ANSWER_DONE event is immediately generated with the
          IREM_COMPLETE modifier in event_mod1 and the IRER_REDUNDANT
          modifier in event_mod2.

     RETURN VALUE
          IRR_OK is returned if the answer request is successfully
          initiated.

          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_SYSERROR if a system or driver call failure occurs (see
          irSysError for additional information)

          IRER_DRIVER_ERROR if a driver call failure occurs (see
          irSysError for additional information)
          IRER_NORESOURCES if the SP for the Primary Rate Interface
          (PRI) D channel is no longer available for answering the
          call

          IRER_SERVICESTATE if the channel is not in the IRD_INACTIVE
          or IRD_RINGING service state (that is, the cid has already
          been answered)

     SEE ALSO
          irServiceState(3IRAPI)

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