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

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

called when we get FACILITY_IND from CAPI with facility selector saying it's DTMF

This method will save the received DTMF to received_dtmf, send a response to Capi and call CallInterface::gotDTMF().

Parameters:
message the received FACILITY_IND message
Exceptions:
CapiError Thrown when an invalid message is received
CapiWrongState Thrown when the message is received unexpected (i.e. in a wrong ncci_state)

Definition at line 550 of file connection.cpp.

References call_if, capi, debug, debug_level, error, Capi::facility_resp(), CallInterface::gotDTMF(), PACT, plci, plci_state, prefix(), and received_dtmf.

{
      if (plci_state!=PACT)
            throw CapiWrongState("FACILITY_IND received in wrong state","Connection::facility_ind_DTMF()");

      if (plci!=(FACILITY_IND_PLCI(&message) & 0xFFFF) ) // this *should* be PLCI, but who knows - so mask NCCI part if it's there...
            throw CapiError("FACILITY_IND received with wrong PLCI","Connection::facility_ind_DTMF()");

      try {
            capi->facility_resp(message.Messagenumber,plci,1);
      }
      catch (CapiMsgError e) {
            error << prefix() << "WARNING: Can't send facility_resp. Message was: " << e << endl;
      }

      _cstruct facilityIndParam=FACILITY_IND_FACILITYINDICATIONPARAMETER(&message);
      received_dtmf.append(reinterpret_cast<char*>(facilityIndParam+1),static_cast<size_t>(facilityIndParam[0]));  //string, length
      if (debug_level >= 2) {
            debug << prefix() << "received DTMF buffer " << received_dtmf << endl;
      }

      if (call_if)
            call_if->gotDTMF();
}


Generated by  Doxygen 1.6.0   Back to index