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

void Connection::start_file_reception ( string  filename  )  throw (CapiWrongState, CapiExternalError)

called to activate receive mode

This method doen't do anything active, it will only set the receive mode for this connection If you don't call this, all received data is discarded. If called, the data B3 stream received is written to this file w/o changes. So it's in the native format given by CAPI (i.e. inserved A-Law for speech, SFF for FaxG3).

Parameters:
filename name of the file to which to save the incoming data
Exceptions:
CapiWrongState Thrown if Connection isn't up completely (physical & logical)
CapiExternalError Thrown if file reception is already in progress or the file couldn't be opened

Definition at line 909 of file connection.cpp.

References debug, debug_level, file_for_reception, NACT, ncci_state, and prefix().

Referenced by FaxReceive::mainLoop(), and AudioReceive::mainLoop().

{
      if (debug_level >= 2) {
            debug << prefix() << "start_file_reception " << filename << endl;
      }
      if (ncci_state!=NACT)
            throw CapiWrongState("unable to receive file because connection is not established","Connection::start_file_reception()");

      if (file_for_reception)
            throw CapiExternalError("file reception is already active","Connection::start_file_reception()");

      file_for_reception=new ofstream(filename.c_str());
      if (! (*file_for_reception)) { // we can't open the file
            delete file_for_reception;
            file_for_reception=NULL;
            throw CapiExternalError("unable to open file for reception ("+filename+")","Connection::start_file_reception()");
      }
}


Generated by  Doxygen 1.6.0   Back to index