From 625d06f2f67ee4c25d5e2ab521d1b1ed60799de9 Mon Sep 17 00:00:00 2001 From: paulc Date: Mon, 14 Mar 2011 15:34:09 +0000 Subject: [PATCH] Accept ISUP CPR and ANM in state Setup if they have Backward Call Indicators. git-svn-id: http://yate.null.ro/svn/yate/trunk@4181 acf43c95-373e-0410-b603-e72c3f656dc1 --- libs/ysig/isup.cpp | 8 ++++---- libs/ysig/yatesig.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ysig/isup.cpp b/libs/ysig/isup.cpp index 9c7e0eb5..1d8b887c 100644 --- a/libs/ysig/isup.cpp +++ b/libs/ysig/isup.cpp @@ -2203,7 +2203,7 @@ SignallingEvent* SS7ISUPCall::getEvent(const Time& when) } // Process received messages msg = static_cast(dequeue()); - if (msg && validMsgState(false,msg->type())) + if (msg && validMsgState(false,msg->type(),(msg->params().getParam("BackwardCallIndicators") != 0))) switch (msg->type()) { case SS7MsgISUP::IAM: case SS7MsgISUP::CCR: @@ -2671,7 +2671,7 @@ void SS7ISUPCall::setReason(const char* reason, SignallingMessage* msg, } // Accept send/receive messages in current state based on call direction -bool SS7ISUPCall::validMsgState(bool send, SS7MsgISUP::Type type) +bool SS7ISUPCall::validMsgState(bool send, SS7MsgISUP::Type type, bool hasBkwCallInd) { bool handled = true; switch (type) { @@ -2692,7 +2692,7 @@ bool SS7ISUPCall::validMsgState(bool send, SS7MsgISUP::Type type) break; return true; case SS7MsgISUP::CPR: // Call progress - if (m_state < Accepted || m_state >= Releasing) + if (m_state < (hasBkwCallInd ? Setup : Accepted) || m_state >= Releasing) break; return true; case SS7MsgISUP::CON: // Connect @@ -2700,7 +2700,7 @@ bool SS7ISUPCall::validMsgState(bool send, SS7MsgISUP::Type type) if (m_state == Setup && send != outgoing()) return true; case SS7MsgISUP::ANM: // Answer - if (m_state < Accepted || m_state >= Answered || send == outgoing()) + if (m_state < (hasBkwCallInd ? Setup : Accepted) || m_state >= Answered || send == outgoing()) break; return true; case SS7MsgISUP::SAM: // Subsequent address diff --git a/libs/ysig/yatesig.h b/libs/ysig/yatesig.h index 7a78ccb6..86d2dbc8 100644 --- a/libs/ysig/yatesig.h +++ b/libs/ysig/yatesig.h @@ -7995,7 +7995,7 @@ private: void setReason(const char* reason, SignallingMessage* msg, const char* diagnostic = 0, const char* location = 0); // Accept send/receive messages in current state based on call direction - bool validMsgState(bool send, SS7MsgISUP::Type type); + bool validMsgState(bool send, SS7MsgISUP::Type type, bool hasBkwCallInd = false); // Connect the reserved circuit. Return false if it fails. Return true if this call is a signalling only one bool connectCircuit(const char* special = 0); // Transmit the IAM message. Start IAM timer if not started