Added continuity check type setting in ISUP. Fixed a format documentation error.

git-svn-id: http://voip.null.ro/svn/yate@3229 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-04-21 12:01:01 +00:00
parent 7795ecc048
commit 5b4cc44e46
3 changed files with 47 additions and 15 deletions

View File

@ -134,10 +134,10 @@
; Defaults to user-provided if missing or incorrect
;screening=user-provided
; format: string: Default data format for outgoing calls. Values: alaw, mulaw, g721
; Defaults to mulaw for ANSI and Japan point codes, alaw for all others
; format: string: Default data format for outgoing calls. Values: alaw, mulaw, g721
; Defaults to alaw if missing or incorrect
; alaw is used commonly in Europe while mulaw is used commonly in US and Japan.
;format=
;format=alaw
; print-messages: boolean: Print decoded protocol data units to output
; This option is applied on reload
@ -313,10 +313,14 @@
; Defaults to user-provided if missing or incorrect
;screening=user-provided
; format: string: Default data format for outgoing calls. Values: alaw, mulaw, g721
; Defaults to alaw if missing or incorrect
; format: string: Default data format for outgoing calls. Values: alaw, mulaw, g721
; Defaults to mulaw for ANSI and Japan point codes, alaw for all others
; alaw is used commonly in Europe while mulaw is used commonly in US and Japan.
;format=alaw
;format=
; continuity: string: Type of continuity check to perform on the circuits
; If not set calls that request continuity check will be rejected
;continuity=
; print-messages: boolean: Print decoded protocol data units to output
; This option is applied on reload

View File

@ -1700,8 +1700,11 @@ SignallingEvent* SS7ISUPCall::getEvent(const Time& when)
switch (m_state) {
case Testing:
case Setup:
if (timeout(isup(),this,m_iamTimer,when,"IAM"))
if (timeout(isup(),this,m_iamTimer,when,"IAM")) {
if (m_circuitTesting)
setReason("nomedia",0);
release();
}
break;
case Releasing:
if (timeout(isup(),this,m_relTimer,when,"REL"))
@ -1836,8 +1839,7 @@ bool SS7ISUPCall::replaceCircuit(SignallingCircuit* circuit)
m_circuit = circuit;
Debug(isup(),DebugNote,"Call(%u). Circuit replaced by %u [%p]",oldId,id(),this);
m_circuitChanged = true;
transmitIAM();
return true;
return transmitIAM();
}
// Stop timers. Send a RLC (Release Complete) message if it should terminate gracefully
@ -2046,16 +2048,22 @@ bool SS7ISUPCall::transmitIAM()
{
if (!m_iamTimer.started())
m_iamTimer.start();
m_state = Setup;
if (!m_iamMsg)
return false;
if (needsTesting(m_iamMsg)) {
if (m_circuitTesting && !(isup() && isup()->m_continuity)) {
Debug(isup(),DebugWarn,"Call(%u). Continuity check requested but not configured [%p]",
id(),this);
return false;
}
Debug(isup(),DebugNote,"Call(%u). %s continuity check [%p]",
id(),(m_circuitTesting ? "Executing" : "Forwarding"),this);
m_state = Testing;
if (m_circuitTesting)
connectCircuit();
connectCircuit(isup()->m_continuity);
}
else
m_state = Setup;
m_iamMsg->m_cic = id();
m_iamMsg->ref();
return transmitMessage(m_iamMsg);
@ -2128,9 +2136,20 @@ SignallingEvent* SS7ISUPCall::processSegmented(SS7MsgISUP* sgm, bool timeout)
// intentionally fall through
case SS7MsgISUP::IAM:
if (needsTesting(m_sgmMsg)) {
if (m_circuitTesting && !(isup() && isup()->m_continuity)) {
Debug(isup(),DebugWarn,"Call(%u). Continuity check requested but not configured [%p]",
id(),this);
setTerminate(true,"service-not-implemented");
TelEngine::destruct(m_sgmMsg);
return 0;
}
if (m_circuitTesting && !connectCircuit(isup()->m_continuity)) {
setTerminate(true,"nomedia");
TelEngine::destruct(m_sgmMsg);
return 0;
}
Debug(isup(),DebugNote,"Call(%u). Waiting for continuity check [%p]",
id(),this);
connectCircuit(m_circuitTesting ? "conttest" : "");
m_state = Testing;
// Save message for later
m_iamMsg = m_sgmMsg;
@ -2203,7 +2222,7 @@ bool SS7ISUPCall::transmitMessage(SS7MsgISUP* msg)
return true;
}
SS7ISUP* SS7ISUPCall::isup()
SS7ISUP* SS7ISUPCall::isup() const
{
return static_cast<SS7ISUP*>(SignallingCall::controller());
}
@ -2303,6 +2322,8 @@ SS7ISUP::SS7ISUP(const NamedList& params)
if (m_uptTimer.interval())
m_userPartAvail = false;
m_continuity = params.getValue("continuity");
setDebug(params.getBoolValue("print-messages",false),
params.getBoolValue("extended-debug",false));
@ -2322,6 +2343,8 @@ SS7ISUP::SS7ISUP(const NamedList& params)
s << " lockcircuits=" << params.getValue("lockcircuits");
s << " userpartavail=" << String::boolText(m_userPartAvail);
s << " lockgroup=" << String::boolText(m_lockGroup);
if (m_continuity)
s << " continuity=" << m_continuity;
Debug(this,DebugInfo,"ISUP Call Controller %s [%p]",s.c_str(),this);
}
}
@ -2507,7 +2530,11 @@ SignallingCall* SS7ISUP::call(SignallingMessage* msg, String& reason)
m_rscTimer.start();
// Drop lock and send the event
mylock.drop();
event->sendEvent();
if (!event->sendEvent()) {
m_calls.remove(call);
call = 0;
reason = "failure";
}
}
TelEngine::destruct(msg);
return call;

View File

@ -5991,7 +5991,7 @@ private:
// Transmit message. Set routing label's link if not already set
inline bool transmitMessage(SS7MsgISUP* msg);
// Get the ISUP call controller
inline SS7ISUP* isup();
inline SS7ISUP* isup() const;
State m_state; // Call state
SignallingCircuit* m_circuit; // Circuit reserved for this call
@ -6277,6 +6277,7 @@ private:
String m_numScreening; // Number screening
String m_callerCat; // Caller party category
String m_format; // Default format
String m_continuity; // Continuity test type
bool m_l3LinkUp; // Flag indicating the availability of a Layer3 data link
// Remote User Part test
SignallingTimer m_uptTimer; // Timer for UPT