r2719 - in trunk: libminisip/source/sip libmsip libmsip/include
libmsip/include/libmsip libmsip/source/transactions
erik at minisip.org
erik at minisip.org
Wed Aug 23 05:41:44 CEST 2006
Author: erik
Date: 2006-08-23 05:41:43 +0200 (Wed, 23 Aug 2006)
New Revision: 2719
Removed:
trunk/libmsip/include/libmsip/SipTransactionInviteClientUA.h
trunk/libmsip/source/transactions/SipTransactionInviteClientUA.cxx
Modified:
trunk/libminisip/source/sip/SipDialogConfVoip.cxx
trunk/libminisip/source/sip/SipDialogVoip.cxx
trunk/libminisip/source/sip/SipDialogVoipClient.cxx
trunk/libminisip/source/sip/SipDialogVoipServer.cxx
trunk/libmsip/Makefile.am
trunk/libmsip/include/Makefile.am
trunk/libmsip/source/transactions/SipTransaction.cxx
Log:
* Removed file not in use any longer:
RFC3261 defines four state machines for the transaction layer
(server/client transactions for both invite and not-invite requests).
Minisip added two state machines that added additional handling
of 2XX/ACK messages. One of them was not in use any longer, and I
therefore removed it.
It was introduced since it could greatly simplify the TU layer
(do we need to keep track of multiple 2XX/ACK now that we do/will
support re-INVITEs, and do we need to figure out which SIP message
to re-transmit at the TU layer when we receive a 2XX
retransmit?!). Adding the logic at the transaction layer introduced
some problems (for example, the ACKs branch does not match the
branch of the transaction, and that is what the transaction
layer expects without additional patching).
Modified: trunk/libminisip/source/sip/SipDialogConfVoip.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogConfVoip.cxx 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libminisip/source/sip/SipDialogConfVoip.cxx 2006-08-23 03:41:43 UTC (rev 2719)
@@ -39,7 +39,6 @@
//#include<libmsip/SipDialogContainer.h>
#include<libmsip/SipResponse.h>
-#include<libmsip/SipTransactionInviteClientUA.h>
#include<libmsip/SipTransactionInviteServerUA.h>
#include<libmsip/SipTransactionNonInviteClient.h>
#include<libmsip/SipTransactionNonInviteServer.h>
Modified: trunk/libminisip/source/sip/SipDialogVoip.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoip.cxx 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libminisip/source/sip/SipDialogVoip.cxx 2006-08-23 03:41:43 UTC (rev 2719)
@@ -37,7 +37,6 @@
#include<libmutil/massert.h>
//#include<libmsip/SipDialogContainer.h>
-#include<libmsip/SipTransactionInviteClientUA.h>
#include<libmsip/SipTransactionInviteServerUA.h>
#include<libmsip/SipTransactionNonInviteClient.h>
#include<libmsip/SipTransactionNonInviteServer.h>
Modified: trunk/libminisip/source/sip/SipDialogVoipClient.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoipClient.cxx 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libminisip/source/sip/SipDialogVoipClient.cxx 2006-08-23 03:41:43 UTC (rev 2719)
@@ -37,7 +37,6 @@
#include<libmutil/massert.h>
-#include<libmsip/SipTransactionInviteClientUA.h>
#include<libmsip/SipTransactionInviteServerUA.h>
#include<libmsip/SipTransactionNonInviteClient.h>
#include<libmsip/SipTransactionNonInviteServer.h>
Modified: trunk/libminisip/source/sip/SipDialogVoipServer.cxx
===================================================================
--- trunk/libminisip/source/sip/SipDialogVoipServer.cxx 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libminisip/source/sip/SipDialogVoipServer.cxx 2006-08-23 03:41:43 UTC (rev 2719)
@@ -36,8 +36,6 @@
#include<libmutil/massert.h>
-//#include<libmsip/SipDialogContainer.h>
-#include<libmsip/SipTransactionInviteClientUA.h>
#include<libmsip/SipTransactionInviteServerUA.h>
#include<libmsip/SipTransactionNonInviteClient.h>
#include<libmsip/SipTransactionNonInviteServer.h>
Modified: trunk/libmsip/Makefile.am
===================================================================
--- trunk/libmsip/Makefile.am 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libmsip/Makefile.am 2006-08-23 03:41:43 UTC (rev 2719)
@@ -43,7 +43,6 @@
source/transactions/SipTransactionNonInviteServer.cxx \
source/transactions/SipTransactionInviteClient.cxx \
source/transactions/SipTransactionInviteServer.cxx \
- source/transactions/SipTransactionInviteClientUA.cxx \
source/transactions/SipTransactionInviteServerUA.cxx \
source/dialogs/SipDialog.cxx \
source/dialogs/SipDialogRegister.cxx \
Modified: trunk/libmsip/include/Makefile.am
===================================================================
--- trunk/libmsip/include/Makefile.am 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libmsip/include/Makefile.am 2006-08-23 03:41:43 UTC (rev 2719)
@@ -51,7 +51,6 @@
libmsip/SipTransactionNonInviteServer.h \
libmsip/SipTransactionInviteClient.h \
libmsip/SipTransactionInviteServer.h \
- libmsip/SipTransactionInviteClientUA.h \
libmsip/SipTransactionInviteServerUA.h \
libmsip/SipMessage.h \
libmsip/SipResponse.h \
Deleted: trunk/libmsip/include/libmsip/SipTransactionInviteClientUA.h
===================================================================
--- trunk/libmsip/include/libmsip/SipTransactionInviteClientUA.h 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libmsip/include/libmsip/SipTransactionInviteClientUA.h 2006-08-23 03:41:43 UTC (rev 2719)
@@ -1,104 +0,0 @@
-/*
- Copyright (C) 2005, 2004 Erik Eliasson, Johan Bilien
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-
-/* Name
- * SipTransactionInviteInitiator.h
- * Author
- * Erik Eliasson, eliasson at it.kth.se
- * Purpose
- *
-*/
-
-
-
-#ifndef SIPTRANSACTIONINVITEICLIENTUA_H
-#define SIPTRANSACTIONINVITEICLIENTUA_H
-
-#include<libmsip/libmsip_config.h>
-
-#include<libmsip/SipSMCommand.h>
-#include<libmsip/SipTransactionInviteClient.h>
-
-/**
- Implement an INVITE Transaction Client UAC,
- as defined in RFC 3261, section 17.1.1
-
- It is composed of the following states:
- start, calling, proceeding, completed, terminated
-
- Transition functions between the states are axxx_description().
-
- There is a transition from any state into TERMINATED, defined in
- the base class SipTransaction::a1000_xxxx()
-
- All transitions are the same as for the parent class, except for
- a5 and a7, which are substituted by a1001 and 1002.
- Transition a1003 is new.
-*/
-class LIBMSIP_API SipTransactionInviteClientUA: public SipTransactionInviteClient{
- public:
- SipTransactionInviteClientUA(MRef<SipStack *> stack,
- //MRef<SipDialog*> d,
- int seq_no,
- const std::string &cSeqMethod,
- const std::string &callid);
-
- virtual ~SipTransactionInviteClientUA();
-
- void changeStateMachine();
-
- virtual std::string getMemObjectType(){return "SipTransactionInviteClientUA";}
-
- virtual std::string getName(){return "transaction_ua_invite_client[branch="+getBranch()+"]";}
- private:
- /**
- Transition from CALLING to COMPLETED
- It subsitutes the transition from CALLING to TERMINATED that
- exhists in its parent class.
- If a final 2xx response is received, we move to the COMPLETED
- state.
- Timer A is cancelled (no more retx)
- Timer B is also cancelled.
- Set Timer D (wait time for response re-tx)
- Forward the 2xx to the TU.
- Send an ACK (transport layer) ... //FIXME:shouldn't it be the TU sending it?
- */
- bool a1001_calling_completed_2xx( const SipSMCommand &command);
-
- /**
- Transition from PROCEEDING to COMPLETED
- Same as a1001, but from the PROCEEDING state.
- Send an ACK (transport layer) ... //FIXME:shouldn't it be the TU sending it?
- */
- bool a1002_proceeding_completed_2xx( const SipSMCommand &command);
-
- /**
- Loop in COMPLETED state.
- While in COMPLETED state, resend an ACK for each 2xx response
- that we receive. Do not notify the TU.
- */
- bool a1003_completed_completed_2xx( const SipSMCommand &command);
-};
-
-#endif
Modified: trunk/libmsip/source/transactions/SipTransaction.cxx
===================================================================
--- trunk/libmsip/source/transactions/SipTransaction.cxx 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libmsip/source/transactions/SipTransaction.cxx 2006-08-23 03:41:43 UTC (rev 2719)
@@ -42,7 +42,6 @@
#include<libmutil/dbg.h>
#include<libmsip/SipTransactionInviteClient.h>
-#include<libmsip/SipTransactionInviteClientUA.h>
#include<libmsip/SipTransactionInviteServer.h>
#include<libmsip/SipTransactionInviteServerUA.h>
#include<libmsip/SipTransactionNonInviteServer.h>
Deleted: trunk/libmsip/source/transactions/SipTransactionInviteClientUA.cxx
===================================================================
--- trunk/libmsip/source/transactions/SipTransactionInviteClientUA.cxx 2006-08-23 03:19:44 UTC (rev 2718)
+++ trunk/libmsip/source/transactions/SipTransactionInviteClientUA.cxx 2006-08-23 03:41:43 UTC (rev 2719)
@@ -1,219 +0,0 @@
-/*
- Copyright (C) 2005, 2004 Erik Eliasson, Johan Bilien
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-/*
- * Authors: Erik Eliasson <eliasson at it.kth.se>
- * Johan Bilien <jobi at via.ecp.fr>
-*/
-
-
-/* Name
- * SipTransactionIntiveInitiator.cxx
- * Author
- * Erik Eliasson, eliasson at it.kth.se
- * Purpose
- *
-*/
-
-
-/*
- start
- o
- |INVITE from TU
- Timer A fires |INVITE sent
- Reset A, V Timer B fires
- INVITE sent +-----------+ or Transport Err.
- +---------| |---------------+inform TU
- | | Calling |---------------)---+
- +-------->| |X------------->| N
- +-----------+ 2xx | | a1001
- | | 2xx to TU | | 2XX
- | |1xx | | 2XX to TU
- 300-699 +---------------+ |1xx to TU | | ACK sent
- ACK sent | | | |
-resp. to TU | 1xx V | |
- | 1xx to TU -----------+ | |
- | +---------| | | |
- | | |Proceeding |-X------------>| |
- | +-------->| | 2xx | |
- | +-----------+ 2xx to TU | |
- | 300-699 | N 2XX a1002 | |
- | ACK sent, | | 2XX to TU | |
- | resp. to TU| | ACK sent | |
- | | | +----------------)---+ NOTE:
- | 300-699 V V V |
- | ACK sent +-----------+Transport Err. | transitions
- | +---------| |Inform TU | labeled with
- | | | Completed |-------------->| the event
- | +-------->| |<--+ | over the action
- | +-----------+ |2XX | to take
- | ^ | N |ACK sent |
- | | | +------+ |
- | | | |
- | | | Timer D fires |
- +--------------+ | - |
- | |
- V |
- +-----------+ |
- | | |
- | Terminated|<--------------+
- | |
- +-----------+
-
-
-*/
-
-
-#include<config.h>
-
-#include<libmsip/SipTransactionInviteClientUA.h>
-#include<libmsip/SipResponse.h>
-#include<libmsip/SipTransactionUtils.h>
-#include<libmsip/SipCommandDispatcher.h>
-#include<libmsip/SipSMCommand.h>
-#include<libmsip/SipDialog.h>
-#include<libmsip/SipDialogConfig.h>
-#include<libmutil/MemObject.h>
-#include<libmutil/dbg.h>
-
-using namespace std;
-
-
-bool SipTransactionInviteClientUA::a1001_calling_completed_2xx( const SipSMCommand &command) {
- if (transitionMatch(SipResponse::type, command, SipSMCommand::transport_layer, SipSMCommand::transaction_layer, "2**")){
- MRef<SipResponse *> resp((SipResponse*) *command.getCommandPacket());
-
- cancelTimeout("timerA");
- cancelTimeout("timerB");
- if( isUnreliable() )
- requestTimeout(sipStack->getTimers()->getD(),"timerD");
- else
- requestTimeout( 0,"timerD");
-
- //update dialogs route set ... needed to add route headers to the ACK we are going to send
- //setDialogRouteSet( resp );
- //assert(dialog); //An invite transaction must always be within a dialog
-
- //TODO/XXX/FIXME: Do this in the TU instead!! --EE
-// dialog->dialogState.updateState( (MRef<SipResponse*>((SipResponse *)*command.getCommandPacket()) ) );
-
- SipSMCommand cmd( command.getCommandPacket(),
- SipSMCommand::transaction_layer,
- SipSMCommand::dialog_layer);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE/*, PRIO_LAST_IN_QUEUE*/ );
-#ifdef DEBUG_OUTPUT
- cerr<<"****************1001************"<<endl;
-#endif
- sendAck(resp, getBranch()+"ACK");
-
- return true;
- }else{
- return false;
- }
-}
-
-bool SipTransactionInviteClientUA::a1002_proceeding_completed_2xx( const SipSMCommand &command) {
- if (transitionMatch(SipResponse::type, command, SipSMCommand::transport_layer, SipSMCommand::transaction_layer, "2**")){
- MRef<SipResponse *> resp((SipResponse*)*command.getCommandPacket());
- cancelTimeout("timerA");
- cancelTimeout("timerB");
- if( isUnreliable() )
- requestTimeout(sipStack->getTimers()->getD(),"timerD");
- else
- requestTimeout( 0,"timerD");
-
- //update dialogs route set ... needed to add route headers to the ACK we are going to send
- //setDialogRouteSet( resp );
- //assert(dialog);
- //TODO/XXX/FIXME: Do in TU instead
- //dialog->dialogState.updateState( (MRef<SipResponse*>((SipResponse *)*command.getCommandPacket()) ) );
-
- SipSMCommand cmd( command.getCommandPacket(),
- SipSMCommand::transaction_layer,
- SipSMCommand::dialog_layer);
- dispatcher->enqueueCommand( cmd, HIGH_PRIO_QUEUE/*, PRIO_LAST_IN_QUEUE*/ );
-#ifdef DEBUG_OUTPUT
- cerr<<"****************1002************"<<endl;
-#endif
- sendAck(resp, getBranch()+"ACK");
-
- return true;
- }else{
- return false;
- }
-}
-
-bool SipTransactionInviteClientUA::a1003_completed_completed_2xx( const SipSMCommand &command) {
- if (transitionMatch(SipResponse::type, command, SipSMCommand::transport_layer, SipSMCommand::transaction_layer, "2**")){
- MRef<SipResponse *> resp((SipResponse*)*command.getCommandPacket());
-#ifdef DEBUG_OUTPUT
- cerr<<"****************1003************"<<endl;
-#endif
- sendAck(resp, getBranch()+"ACK");
-
- return true;
- }else{
- return false;
- }
-}
-
-
-void SipTransactionInviteClientUA::changeStateMachine(){
- MRef<State<SipSMCommand, string> *> s_calling = getState("calling");
- bool success = s_calling->removeTransition("transition_calling_terminated_2xx");
- if (!success)
- merr << "ERROR: Could not remove transition from state machine in SipTransactionInviteClientUA (BUGBUG!!)"<< end;
-
-
- MRef<State<SipSMCommand, string> *>s_proceeding = getState("proceeding");
- success = s_proceeding->removeTransition("transition_proceeding_terminated_2xx");
- if (!success)
- merr << "ERROR: Could not remove transition(2) from state machine in SipTransactionInviteClientUA (BUGBUG!!)"<< end;
-
-
- MRef<State<SipSMCommand, string> *> s_completed= getState("completed");
-
-
-
- new StateTransition<SipSMCommand,string>(this, "transition_calling_completed_2xx",
- (bool (StateMachine<SipSMCommand,string>::*)(const SipSMCommand&)) &SipTransactionInviteClientUA::a1001_calling_completed_2xx,
- s_calling, s_completed);
-
- new StateTransition<SipSMCommand,string>(this, "transition_proceeding_completed_2xx",
- (bool (StateMachine<SipSMCommand,string>::*)(const SipSMCommand&)) &SipTransactionInviteClientUA::a1002_proceeding_completed_2xx,
- s_proceeding, s_completed);
-
- new StateTransition<SipSMCommand,string>(this, "transition_completed_completed_2xx",
- (bool (StateMachine<SipSMCommand,string>::*)(const SipSMCommand&)) &SipTransactionInviteClientUA::a1003_completed_completed_2xx,
- s_completed, s_completed);
-}
-
-
-SipTransactionInviteClientUA::SipTransactionInviteClientUA(MRef<SipStack*> stack,
- //MRef<SipDialog*> call,
- int seq_no,
- const string &cSeqMethod,
- const string &callid):
- SipTransactionInviteClient(stack, /*call,*/ seq_no, cSeqMethod, callid)
-{
- changeStateMachine();
-}
-
-SipTransactionInviteClientUA::~SipTransactionInviteClientUA(){
-}
-
More information about the Minisip-devel
mailing list