r3317 - in trunk/libmsip: include/libmsip source source/transactions
erik at minisip.org
erik at minisip.org
Wed Jun 13 22:21:59 CEST 2007
Author: erik
Date: 2007-06-13 22:21:58 +0200 (Wed, 13 Jun 2007)
New Revision: 3317
Modified:
trunk/libmsip/include/libmsip/SipSMCommand.h
trunk/libmsip/include/libmsip/SipTransactionInviteServer.h
trunk/libmsip/include/libmsip/SipTransactionNonInviteClient.h
trunk/libmsip/source/SipCommandDispatcher.cxx
trunk/libmsip/source/transactions/SipTransactionInviteServer.cxx
trunk/libmsip/source/transactions/SipTransactionNonInviteClient.cxx
Log:
* Non-invite client transaction: Absorb responses when in the "completed"
state.
* Invite server transaction: Absorb ACKs when in the "confirmed" state.
You could notice a warning output when having debug enabled if you
were on a very slow network or a machine with high load/slow.
* Improved the output that is displayed when the SIP stack has not managed
to handle a command. (only when debug is enabled)
Modified: trunk/libmsip/include/libmsip/SipSMCommand.h
===================================================================
--- trunk/libmsip/include/libmsip/SipSMCommand.h 2007-06-13 19:34:28 UTC (rev 3316)
+++ trunk/libmsip/include/libmsip/SipSMCommand.h 2007-06-13 20:21:58 UTC (rev 3317)
@@ -73,10 +73,10 @@
int getSource() const;
void setSource(int s);
- /**
- * This is one of transport_layer, dialog_layer,
- * transaction_layer or dispatcher
- */
+ /**
+ * This is one of transport_layer, dialog_layer,
+ * transaction_layer or dispatcher
+ */
int getDestination() const;
void setDestination(int s);
Modified: trunk/libmsip/include/libmsip/SipTransactionInviteServer.h
===================================================================
--- trunk/libmsip/include/libmsip/SipTransactionInviteServer.h 2007-06-13 19:34:28 UTC (rev 3316)
+++ trunk/libmsip/include/libmsip/SipTransactionInviteServer.h 2007-06-13 20:21:58 UTC (rev 3317)
@@ -194,6 +194,11 @@
bool a10_confirmed_terminated_timerI( const SipSMCommand &command);
/**
+ Absorb ACKs while in confirmed state.
+ */
+ bool a11_confirmed_confirmed_ACK(const SipSMCommand&);
+
+ /**
Transition from PROCEEDING to PROCEEDING
When timer timerRel1xxResend fires, we resend the 1XX response
and double the timer value.
Modified: trunk/libmsip/include/libmsip/SipTransactionNonInviteClient.h
===================================================================
--- trunk/libmsip/include/libmsip/SipTransactionNonInviteClient.h 2007-06-13 19:34:28 UTC (rev 3316)
+++ trunk/libmsip/include/libmsip/SipTransactionNonInviteClient.h 2007-06-13 20:21:58 UTC (rev 3317)
@@ -154,6 +154,8 @@
*/
bool a9_completed_terminated_timerK(const SipSMCommand &command);
+ bool a10_completed_completed_anyresp(const SipSMCommand &);
+
MRef<SipRequest*> lastRequest;
int timerE; //retransmission of the initial request
Modified: trunk/libmsip/source/SipCommandDispatcher.cxx
===================================================================
--- trunk/libmsip/source/SipCommandDispatcher.cxx 2007-06-13 19:34:28 UTC (rev 3316)
+++ trunk/libmsip/source/SipCommandDispatcher.cxx 2007-06-13 20:21:58 UTC (rev 3317)
@@ -147,10 +147,8 @@
#ifdef DEBUG_OUTPUT
- if (handled){
-
- }else{
- merr<<"DISPATCHER: command NOT handled"<<endl;
+ if (!handled){
+ merr << "DISPATCHER: command NOT handled:" << **(item.command) << endl;
}
#endif
@@ -248,7 +246,8 @@
bool ret=false;
if (dst==SipSMCommand::dialog_layer){
- if (c.getSource()!=SipSMCommand::dialog_layer && c.getSource()!=SipSMCommand::transaction_layer){
+ if (c.getSource()!=SipSMCommand::dialog_layer &&
+ c.getSource()!=SipSMCommand::transaction_layer){
mdbg("signaling/sip") << "DISPATCHER: WARNING: Dialog layer is expected to receive commands only from dialog or trasaction"<<endl;
}
ret=dialogLayer->handleCommand(c);
@@ -257,7 +256,10 @@
ret=transactionLayer->handleCommand(c);
}else
if (dst==SipSMCommand::transport_layer){
- if (c.getSource()!=SipSMCommand::transaction_layer){
+ if (c.getSource()!=SipSMCommand::transaction_layer
+ && c.getSource()!=SipSMCommand::transaction_layer
+ && !(c.getType()==SipSMCommand::COMMAND_PACKET
+ && c.getCommandPacket()->getType()=="ACK")){
mdbg("signaling/sip") << "DISPATCHER: WARNING: Transport layer is expected to receive commands only from trasaction"<<endl;
}
ret=transportLayer->handleCommand(c);
Modified: trunk/libmsip/source/transactions/SipTransactionInviteServer.cxx
===================================================================
--- trunk/libmsip/source/transactions/SipTransactionInviteServer.cxx 2007-06-13 19:34:28 UTC (rev 3316)
+++ trunk/libmsip/source/transactions/SipTransactionInviteServer.cxx 2007-06-13 20:21:58 UTC (rev 3317)
@@ -59,9 +59,9 @@
| Timer H fires |
V or Transport Err.|
+-----------+ a9:Inform TU |
- | | |
- | Confirmed | |
- | | |
+ +----| | |
+ a11:ACK | | Confirmed | |
+ - +--->| | |
+-----------+ |
| |
|Timer I fires |
@@ -420,6 +420,24 @@
}
}
+
+/**
+In the Confirmed state we absorb any ACK messages.
+*/
+bool SipTransactionInviteServer::a11_confirmed_confirmed_ACK( const SipSMCommand &command){
+
+ if (transitionMatch("ACK",
+ command,
+ SipSMCommand::transport_layer,
+ SipSMCommand::transaction_layer)){
+ return true;
+ }else{
+ return false;
+ }
+}
+
+
+
bool SipTransactionInviteServer::a20_proceeding_proceeding_timerRel1xxResend( const SipSMCommand &command){
if (transitionMatch(command,
Modified: trunk/libmsip/source/transactions/SipTransactionNonInviteClient.cxx
===================================================================
--- trunk/libmsip/source/transactions/SipTransactionNonInviteClient.cxx 2007-06-13 19:34:28 UTC (rev 3316)
+++ trunk/libmsip/source/transactions/SipTransactionNonInviteClient.cxx 2007-06-13 20:21:58 UTC (rev 3317)
@@ -57,9 +57,9 @@
| | |
| V |
| +-----------+ |
- | | | |
- | | Completed | |
- | | | |
+ | | |----+ a10:*** |
+ | | Completed | | - |
+ | | |<---+ |
| +-----------+ |
| ^ | |
| | | a9: Timer K |
@@ -360,6 +360,18 @@
}
}
+bool SipTransactionNonInviteClient::a10_completed_completed_anyresp( const SipSMCommand &command) {
+ if (transitionMatch(SipResponse::type,
+ command,
+ SipSMCommand::transport_layer,
+ SipSMCommand::transaction_layer,
+ "1**\n2**\n3**\n4**\n5**\n6**"))
+ {
+ return true;
+ }else{
+ return false;
+ }
+}
void SipTransactionNonInviteClient::setUpStateMachine(){
@@ -426,6 +438,11 @@
(bool (StateMachine<SipSMCommand,string>::*)(const SipSMCommand&)) &SipTransactionNonInviteClient::a9_completed_terminated_timerK,
s_completed, s_terminated);
+ new StateTransition<SipSMCommand,string>(this, "transition_completed_completed_anyresp",
+ (bool (StateMachine<SipSMCommand,string>::*)(const SipSMCommand&)) &SipTransactionNonInviteClient::a10_completed_completed_anyresp,
+ s_completed, s_completed);
+
+
setCurrentState(s_start);
}
More information about the Minisip-devel
mailing list