diff --git a/conf.d/ysigchan.conf.sample b/conf.d/ysigchan.conf.sample index 19c35433..d3cc191d 100644 --- a/conf.d/ysigchan.conf.sample +++ b/conf.d/ysigchan.conf.sample @@ -108,7 +108,7 @@ ; The call controller will notify the other side of the link of idle channels ; Set to 0 to disable ; Invalid values default to minimum (60s) -;channelsync=1000 +;channelsync=300 ; channellock: integer: Maximum time (in ms) spent trying to lock a remote channel ; Invalid values default to minimum (2500ms) @@ -313,7 +313,7 @@ ; The call controller will notify the other side of the link of idle channels ; Set to 0 to disable ; Defaults to minimum value (60s) if missing or invalid -;channelsync=1000 +;channelsync=300 ; sls: integer or keyword: Default Signaling Link Selection in outbound calls ; Allowed values: diff --git a/libs/ysig/isup.cpp b/libs/ysig/isup.cpp index 04b1468b..c60e700c 100644 --- a/libs/ysig/isup.cpp +++ b/libs/ysig/isup.cpp @@ -171,6 +171,7 @@ static const TokenDict s_dict_control[] = { { "validate", SS7MsgISUP::CVT }, { "query", SS7MsgISUP::CQM }, { "conttest", SS7MsgISUP::CCR }, + { "reset", SS7MsgISUP::RSC }, { 0, 0 } }; @@ -2447,6 +2448,7 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) m_uptCicCode(0), m_rscTimer(0), m_rscCic(0), + m_rscSpeedup(0), m_lockTimer(0), m_lockGroup(true), m_lockNeed(true), @@ -2512,7 +2514,8 @@ SS7ISUP::SS7ISUP(const NamedList& params, unsigned char sio) if (-1 == lookup(m_callerCat,s_dict_callerCat,-1)) m_callerCat = "ordinary"; - m_rscTimer.interval(params,"channelsync",60,1000,true,true); + m_rscTimer.interval(params,"channelsync",60,300,true,true); + m_rscInterval = m_rscTimer.interval(); m_lockTimer.interval(params,"channellock",2500,10000,false,false); // Remote user part test @@ -2898,6 +2901,10 @@ void SS7ISUP::timerTick(const Time& when) return; } } + if (m_rscSpeedup && !--m_rscSpeedup) { + Debug(this,DebugNote,"Reset interval back to %u ms",m_rscInterval); + m_rscTimer.interval(m_rscInterval); + } m_rscTimer.start(when.msec()); // Pick the next circuit to reset. Ignore circuits locally locked if (m_defPoint && m_remotePoint && @@ -2969,6 +2976,16 @@ bool SS7ISUP::control(NamedList& params) transmitMessage(msg,label,false); } return true; + case SS7MsgISUP::RSC: + if (0 == (m_rscSpeedup = circuits() ? circuits()->count() : 0)) + return false; + // Temporarily speed up reset interval to 10s or as provided + m_rscTimer.interval(params,"interval",2,10,false,true); + Debug(this,DebugNote,"Fast reset of %u circuits every %u ms", + m_rscSpeedup,(unsigned int)m_rscTimer.interval()); + if (m_rscTimer.started()) + m_rscTimer.start(Time::msecNow()); + return true; } mylock.drop(); return SignallingComponent::control(params); diff --git a/libs/ysig/q931.cpp b/libs/ysig/q931.cpp index e3abef2c..30f763f3 100644 --- a/libs/ysig/q931.cpp +++ b/libs/ysig/q931.cpp @@ -2373,7 +2373,7 @@ ISDNQ931::ISDNQ931(const NamedList& params, const char* name) m_l2DownTimer.interval(params,"t309",60000,90000,false); m_recvSgmTimer.interval(params,"t314",3000,4000,false); m_syncCicTimer.interval(params,"t316",4000,5000,false); - m_syncGroupTimer.interval(params,"channelsync",500,1000,true,true); + m_syncGroupTimer.interval(params,"channelsync",60,300,true,true); m_callDiscTimer.interval(params,"t305",0,5000,false); m_callRelTimer.interval(params,"t308",0,5000,false); m_callConTimer.interval(params,"t313",0,5000,false); diff --git a/libs/ysig/yatesig.h b/libs/ysig/yatesig.h index d9230283..a940a1c4 100644 --- a/libs/ysig/yatesig.h +++ b/libs/ysig/yatesig.h @@ -6369,6 +6369,8 @@ private: // Circuit reset SignallingTimer m_rscTimer; // RSC message or idle timeout SignallingCircuit* m_rscCic; // Circuit currently beeing reset + u_int32_t m_rscInterval; // Saved reset interval + u_int32_t m_rscSpeedup; // Circuits left for speedup // Blocking/unblocking circuits SignallingTimer m_lockTimer; // Request timeout bool m_lockGroup; // Allow sending requests for a group