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

void Connection::start_file_transmission ( string  filename  )  throw (CapiError,CapiWrongState,CapiExternalError,CapiMsgError)

called to start sending of a file

The transmission will be controlled automatically by Connection - no further user interaction is necessary if the whole file should be sent.

The file has to be in the correct format expected by CAPI, i.e. bit-reversed A-Law, 8 khz, mono (".la" for sox) for speech, SFF for faxG3

filename the name of the file which should be sent
CapiWrongState Thrown if Connection isn't up completely (physical & logical)
CapiExternalError Thrown if file transmission is already in progress or the file couldn't be opened
CapiMsgError Thrown by send_block(). See there.
CapiError Thrown by send_block(). See there.

Definition at line 854 of file connection.cpp.

References buffers_used, debug, debug_level, file_to_send, NACT, ncci_state, prefix(), send_block(), and send_mutex.

Referenced by FaxSend::mainLoop(), and AudioSend::mainLoop().

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

      if (file_to_send)
            throw CapiExternalError("unable to send file because transmission is already in progress","Connection::start_file_transmission()");

      file_to_send=new ifstream(filename.c_str());

      if (! (*file_to_send)) { // we can't open the file
            delete file_to_send;
            throw CapiExternalError("unable to open file to send ("+filename+")","Connection::start_file_transmission()");
      } else {
            try {
                  while (file_to_send && buffers_used<conf_send_buffers)
            catch (...) {

Generated by  Doxygen 1.6.0   Back to index