Logo Search packages:      
Sourcecode: capisuite version File versions  Download package

void Connection::connect_b3_active_ind ( _cmsg &  message  )  throw (CapiError,CapiWrongState,CapiExternalError) [protected]

called when we get CONNECT_B3_ACTIVE_IND from CAPI

This method will also send a response to Capi and call CallInterface::callConnected().

Parameters:
message the received CONNECT_B3_ACTIVE_IND message
Exceptions:
CapiWrongState Thrown when the message is received unexpected (i.e. in a wrong ncci_state)
CapiExternalError Thrown if no CallInterface is registered
CapiError Thrown if invalid message was received

Definition at line 406 of file connection.cpp.

References call_if, CallInterface::callConnected(), capi, Capi::connect_b3_active_resp(), debug, debug_level, error, fax_info, FAXG3, Connection::fax_info_t::format, Connection::fax_info_t::hiRes, N2, NACT, ncci, ncci_state, Connection::fax_info_t::pages, prefix(), Connection::fax_info_t::rate, service, and Connection::fax_info_t::stationID.

{
      if (ncci_state!=N2) {
            throw CapiWrongState("CONNECT_B3_ACTIVE_IND received in wrong state","Connection::connect_b3_active_ind()");
      } else {
            if (ncci!=CONNECT_B3_ACTIVE_IND_NCCI(&message))
                  throw CapiError("CONNECT_B3_ACTIVE_IND received with wrong NCCI","Connection::connect_b3_active_ind()");
            try {
                  capi->connect_b3_active_resp(message.Messagenumber,ncci);
            }
            catch (CapiMsgError e) {
                  error << prefix() << "WARNING: Error deteced when sending connect_b3_active_resp. Message was: " << e << endl;
            }
            ncci_state=NACT;

            if (service==FAXG3 && CONNECT_B3_ACTIVE_IND_NCPI(&message)[0]>=9) {
                  _cstruct ncpi=CONNECT_B3_ACTIVE_IND_NCPI(&message);
                  if (!fax_info)
                        fax_info=new fax_info_t;
                  fax_info->rate=ncpi[1]+(ncpi[2]<<8);
                  fax_info->hiRes=((ncpi[3] & 0x01) == 0x01);
                  fax_info->format=((ncpi[4] & 0x04) == 0x04);
                  fax_info->pages=ncpi[7]+(ncpi[8]<<8);
                  fax_info->stationID.assign(reinterpret_cast<char*>(&ncpi[10]),static_cast<int>(ncpi[9])); // indx 9 helds the length, string starts at 10
                  if (debug_level >= 2) {
                        debug << prefix() << "fax connected with rate " << dec << fax_info->rate
                          << (fax_info->hiRes ? ", hiRes" : ", lowRes") << (fax_info->format ? ", JPEG" : "")
                          << ", ID: " << fax_info->stationID << endl;
                  }
            }

            if (call_if)
                  call_if->callConnected();
            else
                  throw CapiExternalError("no call control interface registered!","Connection::connect_b3_active_ind()");
      }
}


Generated by  Doxygen 1.6.0   Back to index