Added proper automatic emergency handling in Cisco SLT.

Previous code crashed if a control with no parameters was automatically executed.


git-svn-id: http://voip.null.ro/svn/yate@3807 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-11-12 13:15:29 +00:00
parent e6cf872158
commit d5a790a05b
2 changed files with 8 additions and 2 deletions

View File

@ -63,6 +63,9 @@
; autostart: bool: Automatically try to align the remote MTP2 at startup
;autostart=yes
; autoemergency: boolean: Emergency align link if owner linkset is down
;autoemergency=yes
; configuration: int: Configuration request retransmission interval in ms, 250+
; A zero value disables configuration step and jumps directly to connect request
;configuration=5000

View File

@ -1591,6 +1591,7 @@ SLT::SLT(const String& name, const NamedList& param)
}
m_confReqTimer.interval(param,"configuration",250,5000,true);
m_printMsg = param.getBoolValue("printslt",false);
m_autoEmergency = param.getBoolValue("autoemergency",true);
if (param.getBoolValue("autostart",true))
m_reqStatus = NormalAlignment;
}
@ -1658,8 +1659,10 @@ void SLT::notify(bool up)
bool SLT::control(Operation oper, NamedList* params)
{
if (params)
if (params) {
m_autoEmergency = params->getBoolValue("autoemergency",m_autoEmergency);
m_printMsg = params->getBoolValue("printslt",m_printMsg);
}
switch (oper) {
case Pause:
setReqStatus(OutOfService);
@ -1670,7 +1673,7 @@ bool SLT::control(Operation oper, NamedList* params)
return true;
case Align:
{
bool emg = params->getBoolValue("emergency");
bool emg = getEmergency(params);
setReqStatus(emg ? EmergencyAlignment : NormalAlignment);
switch (m_status) {
case Configured: