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

void Connection::changeProtocol ( service_t  desired_service,
string  faxStationID,
string  faxHeadline 
) throw (CapiMsgError, CapiExternalError, CapiWrongState)

Change the used B protcols (e.g. switch from speech to faxG3).

You have to disconnect the logical connection before calling this method. So to change from speech to fax do:

  • disconnect(LOGICAL_ONLY);
  • wait for CallInterface::CallDisconnectedLogical() to be called
  • changeProtocol(FAXG3,"stationID","headline")
  • wait for CallInterface::callConnected() to be called

Does nothing if the requested service is already active. Otherwise the necessary information elements are built and Capi::select_b_protocol_req is called.

desired_service service to switch to
faxStationID Only needed when switching to FaxG3. The fax station ID to use.
faxHeadline Only needed when switching to FaxG3. The fax headline to use, encoded in ISO8859-1
CapiExternalError Thrown by Connection::buildBconfiguration. See there.
CapiMsgError Thrown by Connection::select_b_protocol_req. See there.
CapiWrongState Connection is in wrong state. Either it was finished by the partner or you didn't disconnect the logical connection before calling changeProtocol

Definition at line 186 of file connection.cpp.

References buildBconfiguration(), capi, debug, debug_level, N0, ncci_state, PACT, plci, plci_state, prefix(), Capi::select_b_protocol_req(), and service.

Referenced by Switch2FaxG3::mainLoop().

      if (debug_level >= 2) {
            debug << prefix() << "Protocol change to " << desired_service << " requested" <<  endl;

      if (ncci_state!=N0 || plci_state!=PACT)
            throw CapiWrongState("wrong state for changeProtocol","Connection::changeProtocol()");

      if (desired_service!=service) {
            _cstruct B1config=NULL, B2config=NULL, B3config=NULL;
            _cword B1proto,B2proto,B3proto;

            try {
                  buildBconfiguration(plci & 0xff, desired_service, faxStationID, faxHeadline, B1proto, B2proto, B3proto, B1config, B2config, B3config);

                  capi->select_b_protocol_req(plci,B1proto,B2proto,B3proto,B1config, B2config, B3config);
            } catch (...) {
                  if (B1config)
                        delete[] B1config;
                  if (B2config)
                        delete[] B2config;
                  if (B3config)
                        delete[] B3config;
            if (B1config)
                  delete[] B1config;
            if (B2config)
                  delete[] B2config;
            if (B3config)
                  delete[] B3config;


Generated by  Doxygen 1.6.0   Back to index