* rework of exception handling stuff; many modules were not

declaring thrown exceptions correctly any more after the
  re-structuring to not throw exceptions on any disconnect


git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@196 4ebea2bb-67d4-0310-8558-a5799e421b66
This commit is contained in:
gernot 2003-12-28 15:00:35 +00:00
parent f9ebdf1fbf
commit d2af0286cd
20 changed files with 290 additions and 139 deletions

View File

@ -1,3 +1,19 @@
2003-12-28 Gernot Hillier <gernot@hillier.de>
* src/modules/audioreceive.{h,cpp} (AudioReceive,mainLoop),
src/modules/audiosend.{h,cpp} (AudioSend,mainLoop),
src/modules/callmodule.{h,cpp} (CallModule,mainLoop),
src/modules/calloutgoing.{h,cpp} (mainLoop),
src/modules/connectmodule.{h,cpp} (ConnectModule,mainLoop),
src/modules/disconnectmodule.{h,cpp} (only comment fixes),
src/modules/faxreceive.{h,cpp} (FaxReceive,mainLoop),
src/modules/faxsend.{h,cpp} (FaxSend,mainLoop),
src/modules/readDTMF.{h,cpp} (ReadDTMF,mainLoop),
src/modules/switch2faxG3.{h,cpp} (Switch2FaxG3,mainLoop):
rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
2003-12-21 Gernot Hillier <gernot@hillier.de>
* src/backend/connection.cpp (buildBconfiguration): accept

View File

@ -2,7 +2,7 @@
@brief Contains AudioReceive - Call Module for receiving audio.
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -50,7 +50,7 @@ unsigned char cswap[256] = {
};
AudioReceive::AudioReceive(Connection *conn, string file, int timeout, int silence_timeout, bool DTMF_exit) throw (CapiExternalError)
AudioReceive::AudioReceive(Connection *conn, string file, int timeout, int silence_timeout, bool DTMF_exit) throw (CapiExternalError,CapiWrongState)
:CallModule(conn, timeout, DTMF_exit),silence_count(0),file(file),start_time(0),end_time(0),
silence_timeout(silence_timeout*8000) // ISDN audio sample rate = 8000Hz
{
@ -59,7 +59,7 @@ AudioReceive::AudioReceive(Connection *conn, string file, int timeout, int silen
}
void
AudioReceive::mainLoop() throw (CapiWrongState, CapiExternalError)
AudioReceive::mainLoop() throw (CapiWrongState,CapiExternalError)
{
start_time=getTime();
if (!(DTMF_exit && (!conn->getDTMF().empty()) ) ) {
@ -104,8 +104,13 @@ AudioReceive::duration()
/* History
$Log: audioreceive.cpp,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.18 2003/01/19 16:50:27 ghillie
- removed severity in exceptions. No FATAL-automatic-exit any more.

View File

@ -2,7 +2,7 @@
@brief Contains AudioReceive - Call Module for receiving audio.
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -26,16 +26,24 @@ using namespace std;
/** @brief Call Module for receiving audio.
This module handles the reception of an audio wave file. It can recognize silence in the signal and timeout after
a given period of silence, after a general timeout or after the reception of a DTMF signal.
If DTMF abort is enabled, the module will abort immediately if the DTMF receiving buffer (see Connection::getDTMF)
isn't empty when it is created. That allows the user to abort subsequent audio receive and send commands with one
DTMF signal w/o needing to check for received DTMF after each command.
This module handles the reception of an audio wave file. It can recognize
silence in the signal and timeout after a given period of silence, after
a general timeout or after the reception of a DTMF signal.
The call must be in audio mode (by connecting with service VOICE), otherwise an exception will be caused.
If DTMF abort is enabled, the module will abort immediately if the DTMF
receiving buffer (see Connection::getDTMF) isn't empty when it is created.
That allows the user to abort subsequent audio receive and send commands
with one DTMF signal w/o needing to check for received DTMF after each
command.
The created file will be saved in the format given by Capi, that is bit-reversed A-Law (or u-Law), 8 kHz mono.
The call must be in audio mode (by connecting with service VOICE),
otherwise an exception will be caused.
CapiWrongState will only be thrown if connection is not up at startup,
not later on. We see a later disconnect as normal event, no error.
The created file will be saved in the format given by Capi, that is
bit-reversed A-Law (or u-Law), 8 kHz, mono.
@author Gernot Hillier
*/
@ -52,17 +60,18 @@ class AudioReceive: public CallModule
@param silence_timeout duration of silence in seconds after which record is finished, 0=no silence detection
@param DTMF_exit true: abort if we receive DTMF during mainLoop() or if DTMF was received before
@throw CapiExternalError Thrown if connection is not in speech mode
*/
AudioReceive(Connection *conn, string file, int timeout, int silence_timeout, bool DTMF_exit) throw (CapiExternalError);
@throw CapiWrongState Thrown if connection is not up (thrown by base class constructor)
*/
AudioReceive(Connection *conn, string file, int timeout, int silence_timeout, bool DTMF_exit) throw (CapiWrongState,CapiExternalError);
/** @brief Start file reception, wait for one of the timeouts or disconnection and stop the reception.
/** @brief Start file reception, wait for one of the timeouts or disconnection and stop the reception.
If the recording was finished because of silence, the silence is truncated away from the recorded file
@throw CapiWrongState Thrown if disconnect is recognized
@throw CapiExternalError Thrown by Connection::start_file_reception().
@throw CapiWrongState Thrown if connection is not up at start of transfer (thrown by Connection::start_file_reception)
*/
void mainLoop() throw (CapiWrongState, CapiExternalError);
void mainLoop() throw (CapiWrongState,CapiExternalError);
/** @brief Test all received audio packets for silence and count silent packets
@ -93,8 +102,13 @@ class AudioReceive: public CallModule
/* History
$Log: audioreceive.h,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.14 2003/01/16 13:03:07 ghillie
- added attribute end_time

View File

@ -2,7 +2,7 @@
@brief Contains AudioSend - Call Module for sending an A-Law file
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -17,7 +17,7 @@
#include "../backend/connection.h"
#include "audiosend.h"
AudioSend::AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiExternalError)
AudioSend::AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiWrongState,CapiExternalError)
:CallModule(conn,-1,DTMF_exit),file(file)
{
if (conn->getService()!=Connection::VOICE)
@ -25,7 +25,7 @@ AudioSend::AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiE
}
void
AudioSend::mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError)
AudioSend::mainLoop() throw (CapiWrongState,CapiExternalError,CapiMsgError)
{
start_time=getTime();
if (!(DTMF_exit && (!conn->getDTMF().empty()) ) ) {
@ -51,8 +51,13 @@ AudioSend::duration()
/* History
$Log: audiosend.cpp,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.14 2003/01/19 16:50:27 ghillie
- removed severity in exceptions. No FATAL-automatic-exit any more.

View File

@ -2,7 +2,7 @@
@brief Contains AudioSend - Call Module for sending an A-Law file
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -26,14 +26,21 @@ using namespace std;
/** @brief Call Module for sending an A-Law file.
This module handles the sending of an audio file. The audio file must be in bit-inversed A-Law format. It can be created for example
with sox using the suffix ".la". It supports abortion if DTMF signal is received.
If DTMF abort is enabled, the module will abort immediately if the DTMF receiving buffer (see Connection::getDTMF)
isn't empty when it is created. That allows the user to abort subsequent audio receive and send commands with one
DTMF signal w/o needing to check for received DTMF after each command.
This module handles the sending of an audio file. The audio file must be in
bit-inversed A-Law format. It can be created for example with sox using the
suffix ".la". It supports abortion if DTMF signal is received.
The connction must be in audio mode (by connecting with service VOICE), otherwise an exception will be caused.
If DTMF abort is enabled, the module will abort immediately if the DTMF
receiving buffer (see Connection::getDTMF) isn't empty when it is created.
That allows the user to abort subsequent audio receive and send commands
with one DTMF signal w/o needing to check for received DTMF after each
command.
The connction must be in audio mode (by connecting with service VOICE),
otherwise an exception will be caused.
CapiWrongState will only be thrown if connection is not up at startup,
not later on. We see a later disconnect as normal event, no error.
@author Gernot Hillier
*/
@ -46,26 +53,27 @@ class AudioSend: public CallModule
@param file name of file to send
@param DTMF_exit set to true, if you want to finish when DTMF signal is received
@throw CapiExternalError Thrown if speech mode isn't established before.
*/
AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiExternalError);
@throw CapiWrongState Thrown if connection is not up (thrown by base class constructor)
*/
AudioSend(Connection *conn, string file, bool DTMF_exit) throw (CapiWrongState,CapiExternalError);
/** @brief Start file transmission, wait for the end of the file or the connection, stop file transmission
/** @brief Start file transmission, wait for the end of the file or the connection, stop file transmission
@throw CapiWrongState Thrown when disconnection takes place.
@throw CapiExternalError Thrown by Connection::start_file_transmission, see there for explanation.
@throw CapiMsgError Thrown by Connection::start_file_transmission, see there for explanation.
*/
void mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError);
@throw CapiWrongState Thrown if connection is not up at start of transfer (thrown by Connection::start_file_transmission)
*/
void mainLoop() throw (CapiWrongState,CapiExternalError,CapiMsgError);
/** @brief finish main loop if file is completely received
/** @brief finish main loop if file is completely received
*/
*/
void transmissionComplete();
/** @brief Return the time in seconds since start of mainLoop()
/** @brief Return the time in seconds since start of mainLoop()
@return time in seconds since start of mainLoop()
*/
*/
long duration();
private:
@ -78,8 +86,13 @@ class AudioSend: public CallModule
/* History
$Log: audiosend.h,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.13 2002/12/04 11:38:50 ghillie
- added time measurement: save time in start_time at the begin of mainLoop() and return difference to getTime() in duration()

View File

@ -2,7 +2,7 @@
@brief Contains CallModule - Base class for all call handling modules
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.3 $
$Revision: 1.4 $
*/
/***************************************************************************
@ -19,7 +19,7 @@
#include "../backend/connection.h"
#include "callmodule.h"
CallModule::CallModule(Connection *connection, int timeout, bool DTMF_exit, bool checkConnection)
CallModule::CallModule(Connection *connection, int timeout, bool DTMF_exit, bool checkConnection) throw (CapiWrongState)
:finish(false),timeout(timeout),conn(connection),DTMF_exit(DTMF_exit)
{
if (conn)
@ -47,7 +47,7 @@ CallModule::callDisconnectedLogical()
}
void
CallModule::mainLoop() throw (CapiWrongState, CapiMsgError, CapiExternalError)
CallModule::mainLoop() throw (CapiWrongState,CapiMsgError, CapiExternalError)
{
if (! (DTMF_exit && (conn->getDTMF()!="") ) ) {
exit_time=getTime()+timeout;
@ -105,6 +105,11 @@ CallModule::gotDTMF()
/* History
$Log: callmodule.cpp,v $
Revision 1.4 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.3 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains CallModule - Base class for all call handling modules
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.4 $
$Revision: 1.5 $
*/
/***************************************************************************
@ -60,8 +60,9 @@ class CallModule: public CallInterface
@param timeout timeout for this module in seconds (only considered in mainLoop!), -1=infinite (default)
@param DTMF_exit if this is set to true, then the current module is exited if we receive a DTMF tone
@param assure connection is up at beginning
@throw CapiWrongState thrown if connection checking was enabled and connection is not up
*/
CallModule(Connection* connection, int timeout=-1, bool DTMF_exit=false, bool checkConnection=true);
CallModule(Connection* connection, int timeout=-1, bool DTMF_exit=false, bool checkConnection=true) throw (CapiWrongState);
/** @brief Destructor. Deregister this module at the according Connection object.
*/
@ -74,8 +75,9 @@ class CallModule: public CallInterface
This method will likely be overwritten in each sub class. You can call CallModule::mainLoop() there to implement busy loops.
@throw CapiMsgError A CAPI function hasn't succeeded for some reason (not thrown by CallModule, but may be thrown in subclasses).
@throw CapiExternalError A given command didn't succeed for a reason not caused by the CAPI (not thrown by CallModule, but may be thrown in subclasses)
*/
virtual void mainLoop() throw (CapiWrongState, CapiMsgError, CapiExternalError);
@throw CapiWrongState Not thrown here, but sub classes may throw it
*/
virtual void mainLoop() throw (CapiWrongState,CapiMsgError,CapiExternalError);
/** @brief empty here.
@ -140,6 +142,11 @@ class CallModule: public CallInterface
/* History
$Log: callmodule.h,v $
Revision 1.5 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.4 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains CallOutgoing - Call Module for establishment of an outgoing connection and wait for successful connect
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -34,7 +34,8 @@ using namespace std;
The timeout will be counted from the moment the other party is alerted,
not from the moment we initiate the call!
You can get the reason for exiting with getResult().
This call module does never throw CapiWrongState! see getResult() if you
need to know if conneciton succeeded.
@author Gernot Hillier
*/
@ -55,14 +56,12 @@ class CallOutgoing: public CallModule
*/
CallOutgoing(Capi *capi, _cdword controller, string call_from, string call_to, Connection::service_t service, int timeout, string faxStationID, string faxHeadline, bool clir);
/** @brief Initiate connection, wait for it to succeed
This call module does never throw CapiWrongState! see getResult() if you need to know if conneciton succeeded.
/** @brief Initiate connection, wait for it to succeed
@throw CapiExternalError Thrown by Connection::Connection(Capi*,_cdword,string,bool,string,service_t,string,string)
@throw CapiMsgError Thrown by Connection::Connection(Capi*,_cdword,string,bool,string,service_t,string,string)
*/
void mainLoop() throw (CapiExternalError, CapiMsgError);
void mainLoop() throw (CapiExternalError,CapiMsgError);
/** @brief Finish if we got connection
@ -107,6 +106,11 @@ class CallOutgoing: public CallModule
/* History
$Log: calloutgoing.h,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/04/17 10:52:12 gernot
- timeout value is now measured beginning at the moment the other party is
signalled

View File

@ -2,7 +2,7 @@
@brief Contains ConnectModule - Call Module for connection establishment at incoming connection
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -16,7 +16,7 @@
#include "connectmodule.h"
ConnectModule::ConnectModule(Connection *conn_in, Connection::service_t service, string faxStationID, string faxHeadline)
ConnectModule::ConnectModule(Connection *conn_in, Connection::service_t service, string faxStationID, string faxHeadline) throw (CapiExternalError)
:CallModule(conn_in,-1,false,false),service(service),faxStationID(faxStationID),faxHeadline(faxHeadline)
{
if (conn->getState()!=Connection::WAITING)
@ -24,7 +24,7 @@ ConnectModule::ConnectModule(Connection *conn_in, Connection::service_t service,
}
void
ConnectModule::mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError)
ConnectModule::mainLoop() throw (CapiWrongState,CapiExternalError,CapiMsgError)
{
conn->connectWaiting(service,faxStationID,faxHeadline);
CallModule::mainLoop();
@ -39,6 +39,11 @@ ConnectModule::callConnected()
/* History
$Log: connectmodule.cpp,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains ConnectModule - Call Module for connection establishment at incoming connection
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -40,16 +40,17 @@ class ConnectModule: public CallModule
@param service service to connect with as described in Connection::service_t
@param faxStationID fax station ID, only necessary when connecting in FAXG3 mode
@param faxHeadline fax headline, only necessary when connecting in FAXG3 mode
@throw CapiExternalError Thrown if Connection not in waiting state
*/
ConnectModule(Connection *conn, Connection::service_t service, string faxStationID, string faxHeadline);
ConnectModule(Connection *conn, Connection::service_t service, string faxStationID, string faxHeadline) throw (CapiExternalError);
/** @brief Accept connection and wait for complete establishment
@throw CapiWrongState Thrown by CallModule::mainLoop()
@throw CapiExternalError Thrown by Connection::connectWaiting()
@throw CapiMsgError Thrown by Connection::connectWaiting()
@throw CapiWrongState Thrown by Connection::connectWaiting()
*/
void mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError);
void mainLoop() throw (CapiWrongState,CapiExternalError, CapiMsgError);
/** @brief Finish mainLoop() if call is completely established
*/
@ -66,8 +67,13 @@ class ConnectModule: public CallModule
/* History
$Log: connectmodule.h,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.7 2002/11/29 10:27:44 ghillie
- updated comments, use doxygen format now

View File

@ -2,7 +2,7 @@
@brief Contains DisconnectModule - Call Module for call clearing
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -15,7 +15,7 @@
***************************************************************************/
#include "disconnectmodule.h"
DisconnectModule::DisconnectModule(Connection *conn, int reject_reason, bool quick_disconnect)
:CallModule(conn,-1,false,false),reject_reason(reject_reason),quick_disconnect(quick_disconnect)
{}
@ -42,6 +42,11 @@ void DisconnectModule::callDisconnectedLogical()
/* History
$Log: disconnectmodule.cpp,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains DisconnectModule - Call Module for call clearing
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -30,6 +30,9 @@ using namespace std;
no problem to call it when the connection is already (partly or completely)
cleared.
There exists nothing like a wrong connection state to disconnect, therefore
CapiWrongState is never thrown.
@author Gernot Hillier
*/
class DisconnectModule: public CallModule
@ -65,6 +68,11 @@ class DisconnectModule: public CallModule
/* History
$Log: disconnectmodule.h,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains FaxReceive - Call Module for receiving an analog fax (group 3)
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -18,7 +18,7 @@
#include "faxreceive.h"
FaxReceive::FaxReceive(Connection *conn, string file) throw (CapiExternalError)
FaxReceive::FaxReceive(Connection *conn, string file) throw (CapiWrongState,CapiExternalError)
:CallModule(conn),file(file)
{
if (conn->getService()!=Connection::FAXG3)
@ -27,7 +27,7 @@ FaxReceive::FaxReceive(Connection *conn, string file) throw (CapiExternalError)
void
FaxReceive::mainLoop() throw (CapiWrongState, CapiExternalError)
FaxReceive::mainLoop() throw (CapiWrongState,CapiExternalError)
{
conn->start_file_reception(file);
CallModule::mainLoop();
@ -43,8 +43,13 @@ FaxReceive::transmissionComplete()
/* History
$Log: faxreceive.cpp,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.12 2003/01/19 16:50:27 ghillie
- removed severity in exceptions. No FATAL-automatic-exit any more.

View File

@ -2,7 +2,7 @@
@brief Contains FaxReceive - Call Module for receiving an analog fax (group 3)
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -26,14 +26,20 @@ using namespace std;
/** @brief Call Module for receiving an analog fax (group 3).
This module handles the reception of an analog fax (fax group 3). It starts the reception and waits for the end of the connection.
This module handles the reception of an analog fax (fax group 3). It starts
the reception and waits for the end of the connection.
Fax polling isn't supported yet.
Fax mode must have been established before using this (by connecting in fax mode or switching to fax with Switch2FaxG3),
otherwise an exception is caused.
The created file will be saved in the format received by Capi, i.e. as Structured Fax File (SFF).
Fax mode must have been established before using this (by connecting in fax
mode or switching to fax with Switch2FaxG3), otherwise an exception is
caused.
CapiWrongState will only be thrown if connection is not up at startup,
not later on. We see a later disconnect as normal event, no error.
The created file will be saved in the format received by Capi, i.e. as
Structured Fax File (SFF).
@author Gernot Hillier
*/
@ -44,16 +50,17 @@ class FaxReceive: public CallModule
@param conn reference to Connection object
@param file name of file to save recorded stream to
@throw CapiWrongState Thrown if connection not up (thrown by base class)
@throw CapiExternalError Thrown if we are not in fax mode.
*/
FaxReceive(Connection *conn, string file) throw (CapiExternalError);
FaxReceive(Connection *conn, string file) throw (CapiWrongState,CapiExternalError);
/** @brief Start file reception, wait for disconnect and stop the reception afterwards
@throw CapiWrongState Thrown when disconnection takes place.
@throw CapiExternalError Thrown by Connection::start_file_reception. See there for explanation.
@throw CapiWrongState Thrown if connection is not up at start of transfer (thrown by Connection::start_file_reception)
*/
void mainLoop() throw (CapiWrongState, CapiExternalError);
void mainLoop() throw (CapiWrongState,CapiExternalError);
/** @brief finish main loop if file is completely received
*/
@ -68,8 +75,13 @@ class FaxReceive: public CallModule
/* History
$Log: faxreceive.h,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.11 2002/12/13 11:47:40 ghillie
- added comment about fax polling

View File

@ -2,7 +2,7 @@
@brief Contains FaxSend - Call Module for sending an analog fax (group 3)
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -18,7 +18,7 @@
#include "faxsend.h"
FaxSend::FaxSend(Connection *conn, string file) throw (CapiExternalError)
FaxSend::FaxSend(Connection *conn, string file) throw (CapiWrongState,CapiExternalError)
:CallModule(conn),file(file)
{
if (conn->getService()!=Connection::FAXG3)
@ -27,7 +27,7 @@ FaxSend::FaxSend(Connection *conn, string file) throw (CapiExternalError)
void
FaxSend::mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError)
FaxSend::mainLoop() throw (CapiWrongState,CapiExternalError,CapiMsgError)
{
conn->start_file_transmission(file);
CallModule::mainLoop();
@ -43,8 +43,13 @@ FaxSend::transmissionComplete()
/* History
$Log: faxsend.cpp,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.2 2003/01/19 16:50:27 ghillie
- removed severity in exceptions. No FATAL-automatic-exit any more.

View File

@ -2,7 +2,7 @@
@brief Contains FaxSend - Call Module for sending an analog fax (group 3)
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -26,14 +26,20 @@ using namespace std;
/** @brief Call Module for sending an analog fax (group 3).
This module handles the send of an analog fax (fax group 3). It starts the send and waits for the end of the connection.
This module handles the send of an analog fax (fax group 3). It starts the
send and waits for the end of the connection.
Fax polling isn't supported yet.
Fax mode must have been established before using this (by connecting in fax mode or switching to fax with Switch2FaxG3),
otherwise an exception is caused.
The given file must be in the format used by Capi, i.e. Structured Fax File (SFF).
Fax mode must have been established before using this (by connecting in fax
mode or switching to fax with Switch2FaxG3), otherwise an exception is
caused.
CapiWrongState will only be thrown if connection is not up at startup,
not later on. We see a later disconnect as normal event, no error.
The given file must be in the format used by Capi, i.e. Structured Fax File
(SFF).
@author Gernot Hillier
*/
@ -45,16 +51,17 @@ class FaxSend: public CallModule
@param conn reference to Connection object
@param file name of file to send
@throw CapiExternalError Thrown if we are not in fax mode.
@throw CapiWrongState Thrown if connection not up (thrown by base class)
*/
FaxSend(Connection *conn, string file) throw (CapiExternalError);
FaxSend(Connection *conn, string file) throw (CapiWrongState,CapiExternalError);
/** @brief Start file send, wait for disconnect and stop the send afterwards
@throw CapiWrongState Thrown when disconnection takes place.
@throw CapiExternalError Thrown by Connection::start_file_transmission. See there for explanation.
@throw CapiMsgError Thrown by Connection::start_file_transmission. See there for explanation.
@throw CapiWrongState Thrown if connection is not up at start of transfer (thrown by Connection::start_file_transmission)
*/
void mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError);
void mainLoop() throw (CapiWrongState,CapiExternalError, CapiMsgError);
/** @brief finish main loop if file is completely sent
*/
@ -69,8 +76,13 @@ class FaxSend: public CallModule
/* History
$Log: faxsend.h,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.1 2002/12/13 11:44:34 ghillie
added support for fax send

View File

@ -2,7 +2,7 @@
@brief Contains ReadDTMF - Call Module for waiting for DTMF signals
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -17,16 +17,14 @@
#include "../backend/connection.h"
#include "readDTMF.h"
ReadDTMF::ReadDTMF(Connection *conn, int timeout, int min_digits, int max_digits)
ReadDTMF::ReadDTMF(Connection *conn, int timeout, int min_digits, int max_digits) throw (CapiWrongState)
:CallModule(conn, timeout, false),min_digits(min_digits),max_digits(max_digits)
{
if (conn->getState()!=Connection::UP)
throw CapiWrongState("Disconnection occured.","ReadDTMF::ReadDTMF()");
digit_count=conn->getDTMF().size();
}
void
ReadDTMF::mainLoop() throw (CapiWrongState)
ReadDTMF::mainLoop() throw ()
{
if (!max_digits || (digit_count < max_digits)) {
do {
@ -64,6 +62,11 @@ ReadDTMF::callDisconnectedLogical()
/* History
$Log: readDTMF.cpp,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains ReadDTMF - Call Module for waiting for DTMF signals
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -23,11 +23,15 @@ class Connection;
/** @brief Call Module for waiting for DTMF signals
This module allows the user to specify how much DTMF digits he wants to read and how long to
wait for them. It doesn't do the actual read, just waits for the given conditions to be fulfilled.
This module allows the user to specify how much DTMF digits he wants to
read and how long to wait for them. It doesn't do the actual read, just
waits for the given conditions to be fulfilled.
To use it, create an object and call mainLoop(). After mainLoop() finished, call
Connection::getDTMF() to read the received signals.
To use it, create an object and call mainLoop(). After mainLoop() finished,
call Connection::getDTMF() to read the received signals.
CapiWrongState will only be thrown if connection is not up at startup,
not later on. We see a later disconnect as normal event, no error.
@author Gernot Hillier
@ -35,25 +39,24 @@ class Connection;
class ReadDTMF: public CallModule
{
public:
/** @brief Constructor. Create Object and read the current digit count from Connection.
/** @brief Constructor. Create Object and read the current digit count from Connection.
@param conn reference to Connection object
@param conn reference to Connection object
@param timeout timeout in seconds after which reading is terminated (only terminates when min_digits are reached!), restarts after each digit
@param min_digits minimum number of digits which must be read in ANY case without respect to timout. Only set to value >0 if you're sure the user will input a digit.
@param max_digits maximum number of digits to read, we abort immediately if this number is reached (0=infinite, only timeout counts)
@throw CapiWrongState Thrown if connection not up (thrown by base class)
*/
ReadDTMF(Connection *conn, int timeout, int min_digits, int max_digits);
ReadDTMF(Connection *conn, int timeout, int min_digits, int max_digits) throw (CapiWrongState);
/** @brief mainLoop: Waits until the given conditions (see constructor) have been fulfilled
/** @brief mainLoop: Waits until the given conditions (see constructor) have been fulfilled
The module will finish if one of these conditions are true:
- max_digits is fulfilled
- timeout was reached AND min_digits is fulfilled
@throw CapiWrongState Thrown if disconnection is recognized
*/
void mainLoop() throw (CapiWrongState);
void mainLoop() throw ();
/** @brief finish if max_digits is reached, otherwise restart timeout when DTMF signal is received
*/
@ -87,6 +90,11 @@ class ReadDTMF: public CallModule
/* History
$Log: readDTMF.h,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains Switch2FaxG3 - Call Module for switching to FAXG3 service from another one.
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.2 $
$Revision: 1.3 $
*/
/***************************************************************************
@ -17,7 +17,7 @@
#include "../backend/connection.h"
#include "switch2faxG3.h"
Switch2FaxG3::Switch2FaxG3(Connection *conn_in, string faxStationID, string faxHeadline)
Switch2FaxG3::Switch2FaxG3(Connection *conn_in, string faxStationID, string faxHeadline) throw (CapiWrongState)
:CallModule(conn_in), faxStationID(faxStationID), faxHeadline(faxHeadline)
{}
@ -48,6 +48,11 @@ Switch2FaxG3::callConnected()
/* History
$Log: switch2faxG3.cpp,v $
Revision 1.3 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.2 2003/10/03 14:56:40 gernot
- partly implementation of a bigger semantic change: don't throw
call finished exceptions in normal operation any longer; i.e. we only

View File

@ -2,7 +2,7 @@
@brief Contains Switch2FaxG3 - Call Module for switching to FAXG3 service from another one.
@author Gernot Hillier <gernot@hillier.de>
$Revision: 1.1 $
$Revision: 1.2 $
*/
/***************************************************************************
@ -32,32 +32,35 @@ using namespace std;
- wait for completion of disconnect
- call Connection::changeProtocol() to switch to faxG3
- wait for logical connection to re-establish
We throw CapiWrongState whenever disconnection occurs.
*/
class Switch2FaxG3: public CallModule
{
public:
/** @brief Constructor. Create object.
/** @brief Constructor. Create object.
@param conn reference to Connection object
@param conn reference to Connection object
@param faxStationID fax station ID to use
@param faxHeadline fax headline to use
*/
Switch2FaxG3(Connection *conn, string faxStationID, string faxHeadline);
@throw CapiWrongState Thrown if connection not up (thrown by base class)
*/
Switch2FaxG3(Connection *conn, string faxStationID, string faxHeadline) throw (CapiWrongState);
/** @brief Do all needed steps (disconnect logical, wait, switch to fax, wait).
@throw CapiWrongState Thrown by CallModule::mainLoop, Connection::changeProtocol
/** @brief Do all needed steps (disconnect logical, wait, switch to fax, wait).
@throw CapiWrongState Thrown by Connection::changeProtocol
@throw CapiExternalError Thrown by Connection::changeProtocol
@throw CapiMsgError Thrown by Connection::changeProtocol, Connection::disconnectCall
*/
*/
void mainLoop() throw (CapiWrongState, CapiExternalError, CapiMsgError);
/** @brief Finish first wait if the logical disconnection succeeded.
*/
*/
void callDisconnectedLogical();
/** @brief Finish second wait if logical connection has been re-established
*/
/** @brief Finish second wait if logical connection has been re-established
*/
void callConnected();
@ -71,8 +74,13 @@ class Switch2FaxG3: public CallModule
/* History
$Log: switch2faxG3.h,v $
Revision 1.1 2003/02/19 08:19:53 gernot
Initial revision
Revision 1.2 2003/12/28 15:00:35 gernot
* rework of exception handling stuff; many modules were not
declaring thrown exceptions correctly any more after the
re-structuring to not throw exceptions on any disconnect
Revision 1.1.1.1 2003/02/19 08:19:53 gernot
initial checkin of 0.4
Revision 1.3 2002/12/02 12:32:54 ghillie
renamed Connection::SPEECH to Connection::VOICE