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

void Connection::disconnectCall ( disconnect_mode_t  disconnect_mode = ALL  )  throw (CapiMsgError)

Terminate this connection.

According to the current state and the given mode, the needed steps to disconnect will be executed.

If you don't specify a mode, the connection will be completely cleared (first logical, then physical).

It doesn't throw any error if you call it for an already cleared connection, so it's safe to call it more than one time.

To reject a waiting call you haven't accepted earlier, use rejectWaiting(), not disconnectCall().

Attention: Connection objects will not be deleted after the disconnection. You must delete the Connection object explicitly. The reason for this behavior is to allow you to get connection related information (like disconnect cause, ...) after the connection has cleared. See also CallInterface::callDisconnectedPhysical().

Parameters:
disconnect_mode see description of disconnect_mode_t
Exceptions:
CapiMsgError Thrown by Capi::disconnect_b3_req() or Capi::disconnect_req(). See there.

Definition at line 786 of file connection.cpp.

References ALL, capi, debug, debug_level, Capi::disconnect_b3_req(), Capi::disconnect_req(), keepPhysicalConnection, LOGICAL_ONLY, N1, N2, N3, N4, NACT, ncci, ncci_state, P1, P2, P3, P4, P5, PACT, PHYSICAL_ONLY, plci, plci_state, and prefix().

Referenced by Switch2FaxG3::mainLoop(), DisconnectModule::mainLoop(), CallOutgoing::mainLoop(), and ~Connection().

{
      if (debug_level >= 1) {
            debug << prefix() << "disconnect initiated" << endl;
      }
      if ((ncci_state==N1 || ncci_state==N2 || ncci_state==N3 || ncci_state==NACT) && (disconnect_mode==ALL || disconnect_mode==LOGICAL_ONLY) ) {  // logical connection up
            ncci_state=N4;
            capi->disconnect_b3_req(ncci); // can throw CapiMsgError. Fatal here. Propagate
            if (disconnect_mode==LOGICAL_ONLY)
                  keepPhysicalConnection=true;
      } else if ((plci_state==PACT || plci_state==P1 || plci_state==P2 || plci_state==P3 || plci_state==P4) && (disconnect_mode==ALL || disconnect_mode==PHYSICAL_ONLY) ) { // physical connection up
            plci_state=P5;
            capi->disconnect_req(plci); // can throw CapiMsgError. Fatal here. Propagate
      }
      // otherwise do nothing
}


Generated by  Doxygen 1.6.0   Back to index