Change call status before checking the bearer so any call cleanup is executed correctly.
Got rid of some useless instruction blocks. git-svn-id: http://yate.null.ro/svn/yate/trunk@4379 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
b77429d566
commit
b3aa286f0f
|
@ -2930,6 +2930,7 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout)
|
||||||
// intentionally fall through
|
// intentionally fall through
|
||||||
case SS7MsgISUP::IAM:
|
case SS7MsgISUP::IAM:
|
||||||
if (needsTesting(m_sgmMsg)) {
|
if (needsTesting(m_sgmMsg)) {
|
||||||
|
m_state = Testing;
|
||||||
if (m_circuitTesting && !(isup() && isup()->m_continuity)) {
|
if (m_circuitTesting && !(isup() && isup()->m_continuity)) {
|
||||||
Debug(isup(),DebugWarn,"Call(%u). Continuity check requested but not configured [%p]",
|
Debug(isup(),DebugWarn,"Call(%u). Continuity check requested but not configured [%p]",
|
||||||
id(),this);
|
id(),this);
|
||||||
|
@ -2942,23 +2943,23 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout)
|
||||||
}
|
}
|
||||||
Debug(isup(),DebugNote,"Call(%u). Waiting for continuity check [%p]",
|
Debug(isup(),DebugNote,"Call(%u). Waiting for continuity check [%p]",
|
||||||
id(),this);
|
id(),this);
|
||||||
m_state = Testing;
|
|
||||||
// Save message for later
|
// Save message for later
|
||||||
m_iamMsg = m_sgmMsg;
|
m_iamMsg = m_sgmMsg;
|
||||||
m_sgmMsg = 0;
|
m_sgmMsg = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
m_state = Setup;
|
||||||
if (!connectCircuit() && isup() &&
|
if (!connectCircuit() && isup() &&
|
||||||
(isup()->mediaRequired() >= SignallingCallControl::MediaAlways)) {
|
(isup()->mediaRequired() >= SignallingCallControl::MediaAlways)) {
|
||||||
setTerminate(true,"bearer-cap-not-available",0,isup()->location());
|
setTerminate(true,"bearer-cap-not-available",0,isup()->location());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_state = Setup;
|
|
||||||
m_sgmMsg->params().setParam("overlapped",String::boolText(m_overlap));
|
m_sgmMsg->params().setParam("overlapped",String::boolText(m_overlap));
|
||||||
m_lastEvent = new SignallingEvent(SignallingEvent::NewCall,m_sgmMsg,this);
|
m_lastEvent = new SignallingEvent(SignallingEvent::NewCall,m_sgmMsg,this);
|
||||||
break;
|
break;
|
||||||
case SS7MsgISUP::CCR:
|
case SS7MsgISUP::CCR:
|
||||||
if (m_state < Testing) {
|
if (m_state < Testing) {
|
||||||
|
m_state = Testing;
|
||||||
if (!(isup() && isup()->m_continuity)) {
|
if (!(isup() && isup()->m_continuity)) {
|
||||||
Debug(isup(),DebugWarn,"Call(%u). Continuity check requested but not configured [%p]",
|
Debug(isup(),DebugWarn,"Call(%u). Continuity check requested but not configured [%p]",
|
||||||
id(),this);
|
id(),this);
|
||||||
|
@ -2972,7 +2973,6 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout)
|
||||||
}
|
}
|
||||||
Debug(isup(),DebugNote,"Call(%u). Continuity test only [%p]",
|
Debug(isup(),DebugNote,"Call(%u). Continuity test only [%p]",
|
||||||
id(),this);
|
id(),this);
|
||||||
m_state = Testing;
|
|
||||||
}
|
}
|
||||||
else if (!m_circuitTesting) {
|
else if (!m_circuitTesting) {
|
||||||
setTerminate(true,"wrong-state-message",0,isup()->location());
|
setTerminate(true,"wrong-state-message",0,isup()->location());
|
||||||
|
@ -2984,62 +2984,60 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout)
|
||||||
transmitMessage(new SS7MsgISUP(SS7MsgISUP::LPA,id()));
|
transmitMessage(new SS7MsgISUP(SS7MsgISUP::LPA,id()));
|
||||||
break;
|
break;
|
||||||
case SS7MsgISUP::ACM:
|
case SS7MsgISUP::ACM:
|
||||||
|
m_state = Accepted;
|
||||||
if (!connectCircuit() && isup() &&
|
if (!connectCircuit() && isup() &&
|
||||||
(isup()->mediaRequired() >= SignallingCallControl::MediaAlways)) {
|
(isup()->mediaRequired() >= SignallingCallControl::MediaAlways)) {
|
||||||
setReason("bearer-cap-not-available",0,0,isup()->location());
|
setReason("bearer-cap-not-available",0,0,isup()->location());
|
||||||
m_lastEvent = release();
|
m_lastEvent = release();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_state = Accepted;
|
m_lastEvent = 0;
|
||||||
{
|
m_inbandAvailable = m_inbandAvailable ||
|
||||||
m_lastEvent = 0;
|
SignallingUtils::hasFlag(m_sgmMsg->params(),"OptionalBackwardCallIndicators","inband");
|
||||||
m_inbandAvailable = m_inbandAvailable ||
|
if (isup() && isup()->m_earlyAcm) {
|
||||||
SignallingUtils::hasFlag(m_sgmMsg->params(),"OptionalBackwardCallIndicators","inband");
|
// If the called party is known free report ringing
|
||||||
if (isup() && isup()->m_earlyAcm) {
|
// If it may become free or there is inband audio report progress
|
||||||
// If the called party is known free report ringing
|
bool ring = SignallingUtils::hasFlag(m_sgmMsg->params(),"BackwardCallIndicators","called-free");
|
||||||
// If it may become free or there is inband audio report progress
|
if (m_inbandAvailable || ring || SignallingUtils::hasFlag(m_sgmMsg->params(),"BackwardCallIndicators","called-conn")) {
|
||||||
bool ring = SignallingUtils::hasFlag(m_sgmMsg->params(),"BackwardCallIndicators","called-free");
|
|
||||||
if (m_inbandAvailable || ring || SignallingUtils::hasFlag(m_sgmMsg->params(),"BackwardCallIndicators","called-conn")) {
|
|
||||||
m_sgmMsg->params().setParam("earlymedia",String::boolText(m_inbandAvailable));
|
|
||||||
m_lastEvent = new SignallingEvent(ring ? SignallingEvent::Ringing : SignallingEvent::Progress,m_sgmMsg,this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!m_lastEvent) {
|
|
||||||
m_sgmMsg->params().setParam("earlymedia",String::boolText(m_inbandAvailable));
|
m_sgmMsg->params().setParam("earlymedia",String::boolText(m_inbandAvailable));
|
||||||
m_lastEvent = new SignallingEvent(SignallingEvent::Accept,m_sgmMsg,this);
|
m_lastEvent = new SignallingEvent(ring ? SignallingEvent::Ringing : SignallingEvent::Progress,m_sgmMsg,this);
|
||||||
}
|
|
||||||
// Start T9 timer
|
|
||||||
if (isup()->m_t9Interval) {
|
|
||||||
m_anmTimer.interval(isup()->m_t9Interval);
|
|
||||||
m_anmTimer.start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!m_lastEvent) {
|
||||||
|
m_sgmMsg->params().setParam("earlymedia",String::boolText(m_inbandAvailable));
|
||||||
|
m_lastEvent = new SignallingEvent(SignallingEvent::Accept,m_sgmMsg,this);
|
||||||
|
}
|
||||||
|
// Start T9 timer
|
||||||
|
if (isup()->m_t9Interval) {
|
||||||
|
m_anmTimer.interval(isup()->m_t9Interval);
|
||||||
|
m_anmTimer.start();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SS7MsgISUP::CPR:
|
case SS7MsgISUP::CPR:
|
||||||
|
m_state = Ringing;
|
||||||
if (!connectCircuit() && isup() &&
|
if (!connectCircuit() && isup() &&
|
||||||
(isup()->mediaRequired() >= SignallingCallControl::MediaRinging)) {
|
(isup()->mediaRequired() >= SignallingCallControl::MediaRinging)) {
|
||||||
setTerminate(true,"bearer-cap-not-available",0,isup()->location());
|
setTerminate(true,"bearer-cap-not-available",0,isup()->location());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_state = Ringing;
|
m_inbandAvailable = m_inbandAvailable ||
|
||||||
{
|
SignallingUtils::hasFlag(m_sgmMsg->params(),"OptionalBackwardCallIndicators","inband") ||
|
||||||
bool ring = SignallingUtils::hasFlag(m_sgmMsg->params(),"EventInformation","ringing");
|
SignallingUtils::hasFlag(m_sgmMsg->params(),"EventInformation","inband");
|
||||||
m_inbandAvailable = m_inbandAvailable ||
|
m_sgmMsg->params().setParam("earlymedia",String::boolText(m_inbandAvailable));
|
||||||
SignallingUtils::hasFlag(m_sgmMsg->params(),"OptionalBackwardCallIndicators","inband") ||
|
m_lastEvent = new SignallingEvent(
|
||||||
SignallingUtils::hasFlag(m_sgmMsg->params(),"EventInformation","inband");
|
SignallingUtils::hasFlag(m_sgmMsg->params(),"EventInformation","ringing")
|
||||||
m_sgmMsg->params().setParam("earlymedia",String::boolText(m_inbandAvailable));
|
? SignallingEvent::Ringing : SignallingEvent::Progress,
|
||||||
m_lastEvent = new SignallingEvent(ring ? SignallingEvent::Ringing : SignallingEvent::Progress,m_sgmMsg,this);
|
m_sgmMsg,this);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SS7MsgISUP::ANM:
|
case SS7MsgISUP::ANM:
|
||||||
case SS7MsgISUP::CON:
|
case SS7MsgISUP::CON:
|
||||||
|
m_state = Answered;
|
||||||
|
m_anmTimer.stop();
|
||||||
if (!connectCircuit() && isup() &&
|
if (!connectCircuit() && isup() &&
|
||||||
(isup()->mediaRequired() >= SignallingCallControl::MediaAnswered)) {
|
(isup()->mediaRequired() >= SignallingCallControl::MediaAnswered)) {
|
||||||
setTerminate(true,"bearer-cap-not-available",0,isup()->location());
|
setTerminate(true,"bearer-cap-not-available",0,isup()->location());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_state = Answered;
|
|
||||||
m_anmTimer.stop();
|
|
||||||
m_lastEvent = new SignallingEvent(SignallingEvent::Answer,m_sgmMsg,this);
|
m_lastEvent = new SignallingEvent(SignallingEvent::Answer,m_sgmMsg,this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue