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

bool Connection::info_ind_called_party_nr ( _cmsg &  message  )  throw (CapiError,CapiWrongState) [protected]

called when we get INFO_IND from CAPI with Info number saying it's ALERTING

This method will understand additional Called Party Number Info Elements to get the DDI (necessary for getting the whole number in PtP configuration as the DDI is signalled after* CONNECT_IND.

Parameters:
message the received INFO_IND message
Returns:
true if the CalledPartyNumber is complete (DDI length fulfilled or stop_number found)
Exceptions:
CapiError Thrown when an invalid message is received
CapiWrongState Thrown when the message is received unexpected (i.e. in a wrong plci_state)

Definition at line 596 of file connection.cpp.

References call_to, capi, DDIBaseLength, DDILength, DDIStopNumbers, debug, debug_level, error, getNumber(), Capi::info_resp(), P2, plci, plci_state, and prefix().

{
      if (plci_state!=P2)
            throw CapiWrongState("INFO_IND for CalledPartyNr received in wrong state",
              "Connection::info_ind_called_party_nr()");

      if (plci!=INFO_IND_PLCI(&message))
            throw CapiError("INFO_IND received with wrong PLCI",
              "Connection::info_ind_called_party_nr()");
      try {
            capi->info_resp(message.Messagenumber,plci);
      }
      catch (CapiMsgError e) {
            error << prefix() << "WARNING: Can't send info_resp. Message was: " << 
              e << endl;
      }

      call_to+=getNumber(INFO_IND_INFOELEMENT(&message),false);
      
      string currDDI;
      try {
            currDDI=call_to.substr(DDIBaseLength);
      }
      catch (std::out_of_range e) {
            throw CapiError("DDIBaseLength too big - configuration error?",
              "Connection::info_ind_called_party_nr()");
      }
      for (int i=0;i<DDIStopNumbers.size();i++)
          if (DDIStopNumbers[i]==currDDI) {
                  if (debug_level >= 1)
                        debug << prefix() << "got DDI, nr is now " << call_to << " (complete,stop_nr)" << endl;
                  return true;
          }

      if (call_to.length()>=DDIBaseLength+DDILength) {
            if (debug_level >=1)
                  debug << prefix() << "got DDI, nr is now " << call_to << " (complete)" << endl;
            return true;
      } else {
            if (debug_level >=1)
                        debug << prefix() << "got DDI, nr is now " << call_to << " (incomplete)" << endl;
                return false;
      }
}


Generated by  Doxygen 1.6.0   Back to index