From 8861fe7d4652e62a53e044828e2c490de388787b Mon Sep 17 00:00:00 2001 From: gernot Date: Wed, 31 Dec 2003 16:28:55 +0000 Subject: [PATCH] * src/modules/connectmodule.{h,cpp} (ConnectModule): throw CapiExternalError only when connection's already up, otherwise use CapiWrongState git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@201 4ebea2bb-67d4-0310-8558-a5799e421b66 --- ChangeLog | 7 ++++--- src/modules/connectmodule.cpp | 8 +++++--- src/modules/connectmodule.h | 12 +++++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13f7a52..e5e764f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,12 @@ 2003-12-31 Gernot Hillier + * src/modules/connectmodule.{h,cpp} (ConnectModule): throw + CapiExternalError only when connection's already up, otherwise + use CapiWrongState + * scripts/incoming.py (voiceIncoming): include recorded msg length and host name were file is stored in sent mail (closes bug #6, thx to Achim Bohnet and Thomas Niesel for the feature requests) -2003-12-31 Gernot Hillier * scripts/cs_helpers.pyin (sendMIMEMail): use 16 bit ouput when converting sound files from la to wav. Thx to Holger Krull for the fix (closes bug #51)! @@ -13,8 +16,6 @@ adding of CVS log messages to source files as we now have this nice ChangeLog file -2003-12-28 Gernot Hillier - * src/modules/audioreceive.{h,cpp} (AudioReceive,mainLoop), src/modules/audiosend.{h,cpp} (AudioSend,mainLoop), src/modules/callmodule.{h,cpp} (CallModule,mainLoop), diff --git a/src/modules/connectmodule.cpp b/src/modules/connectmodule.cpp index 2bee561..df10b22 100644 --- a/src/modules/connectmodule.cpp +++ b/src/modules/connectmodule.cpp @@ -2,7 +2,7 @@ @brief Contains ConnectModule - Call Module for connection establishment at incoming connection @author Gernot Hillier - $Revision: 1.4 $ + $Revision: 1.5 $ */ /*************************************************************************** @@ -16,11 +16,13 @@ #include "connectmodule.h" -ConnectModule::ConnectModule(Connection *conn_in, Connection::service_t service, string faxStationID, string faxHeadline) throw (CapiExternalError) +ConnectModule::ConnectModule(Connection *conn_in, Connection::service_t service, string faxStationID, string faxHeadline) throw (CapiWrongState,CapiExternalError) :CallModule(conn_in,-1,false,false),service(service),faxStationID(faxStationID),faxHeadline(faxHeadline) { + if (conn->getState()==Connection::UP) + throw CapiExternalError("Call is already connected","ConnectModule::ConnectModule()"); if (conn->getState()!=Connection::WAITING) - throw CapiExternalError("Can't connect because call not waiting","ConnectModule::ConnectModule()"); + throw CapiWrongState("Can't connect because call not waiting","ConnectModule::ConnectModule()"); } void diff --git a/src/modules/connectmodule.h b/src/modules/connectmodule.h index 93cec62..6013c2b 100644 --- a/src/modules/connectmodule.h +++ b/src/modules/connectmodule.h @@ -2,7 +2,7 @@ @brief Contains ConnectModule - Call Module for connection establishment at incoming connection @author Gernot Hillier - $Revision: 1.3 $ + $Revision: 1.4 $ */ /*************************************************************************** @@ -40,9 +40,10 @@ 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 + @throw CapiExternalError Thrown if Connection already up + @throw CapiWrongState Thrown if Connection not in waiting state */ - ConnectModule(Connection *conn, Connection::service_t service, string faxStationID, string faxHeadline) throw (CapiExternalError); + ConnectModule(Connection *conn, Connection::service_t service, string faxStationID, string faxHeadline) throw (CapiWrongState,CapiExternalError); /** @brief Accept connection and wait for complete establishment @@ -67,6 +68,11 @@ class ConnectModule: public CallModule /* History $Log: connectmodule.h,v $ +Revision 1.4 2003/12/31 16:28:55 gernot +* src/modules/connectmodule.{h,cpp} (ConnectModule): throw + CapiExternalError only when connection's already up, otherwise + use CapiWrongState + Revision 1.3 2003/12/28 21:01:04 gernot - reworked TODO, disabled automatic log message adding to source files