Differentiate "No component could process the command" and "The component failed to process the command" in rmanager control output.
git-svn-id: http://voip.null.ro/svn/yate@5396 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
de69991374
commit
f8944670c6
|
@ -52,15 +52,16 @@
|
|||
; reject = 78 - 100
|
||||
|
||||
; NOTE! : Parameters can be appended with chan.control message and with rmanager command
|
||||
; The target name must have "cpu." prefix
|
||||
; Example: rmanager
|
||||
; "control cpuload section target_name=interval_name,threshold_value,hysteresis_value;......"
|
||||
; "control cpuload section cpu.target_name=interval_name,threshold_value,hysteresis_value;......"
|
||||
; where "section" represents one from the sections above
|
||||
; Example: chan.control
|
||||
; Message* m = new Message("chan.control");
|
||||
; m->addParam("targetid","cpuload");
|
||||
; m->addParam("component","cpuload");
|
||||
; m->addParam("operation",monitor); // One of the following : kernelLoad,userLoad,totalLoad,systemLoad
|
||||
; m->addParam("engine","interval_name,threshold_value,hysteresis_value;...... ");
|
||||
; m->addParam("cpu.engine","interval_name,threshold_value,hysteresis_value;...... ");
|
||||
; Engine::enqueue(m); // Engine::dispatch(m);
|
||||
|
||||
; NOTE! : Target "engine" is reserved for engine call accept. If you want to modify engine monitors
|
||||
|
|
|
@ -1055,6 +1055,7 @@ bool DataEndpoint::clearData(DataNode* node)
|
|||
// Change source(s) or consumer(s)
|
||||
bool DataEndpoint::control(NamedList& params)
|
||||
{
|
||||
// TODO how do we handle this case????? operation-status
|
||||
return (m_source && m_source->control(params)) ||
|
||||
(m_consumer && m_consumer->control(params)) ||
|
||||
(m_peerRecord && m_peerRecord->control(params)) ||
|
||||
|
|
|
@ -432,6 +432,19 @@ static void dbg_dist_helper(int level, const char* buf, const char* fmt, ...)
|
|||
va_end(va);
|
||||
}
|
||||
|
||||
bool controlReturn(NamedList* params, bool ret, const char* retVal)
|
||||
{
|
||||
if (retVal && params)
|
||||
params->setParam("retVal",retVal);
|
||||
if (ret || !params || !params->getObject("Message"))
|
||||
return ret;
|
||||
const char* module = params->getValue("module");
|
||||
if (!module || YSTRING("rmanager") != module)
|
||||
return ret;
|
||||
params->setParam("operation-status",String(ret));
|
||||
return true;
|
||||
}
|
||||
|
||||
Debugger::~Debugger()
|
||||
{
|
||||
if (m_name) {
|
||||
|
|
|
@ -226,8 +226,8 @@ bool SignallingDumpable::control(NamedList& params, SignallingComponent* owner)
|
|||
}
|
||||
tmp = params.getParam(YSTRING("file"));
|
||||
if (tmp)
|
||||
return setDumper(*tmp);
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,setDumper(*tmp));
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
|
||||
/* vi: set ts=8 sw=4 sts=4 noet: */
|
||||
|
|
|
@ -445,6 +445,9 @@ bool SignallingEngine::control(NamedList& params)
|
|||
Lock mylock(this);
|
||||
for (ObjList* l = m_components.skipNull(); l; l = l->skipNext())
|
||||
ok = static_cast<SignallingComponent*>(l->get())->control(params) || ok;
|
||||
// Do not add operation-status here !!
|
||||
// The handler should return false because the message wasn't processed
|
||||
// by any component
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ bool SignallingInterface::control(Operation oper, NamedList* params)
|
|||
{
|
||||
DDebug(this,DebugInfo,"Unhandled SignallingInterface::control(%d,%p) [%p]",
|
||||
oper,params,this);
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
}
|
||||
|
||||
bool SignallingInterface::receivedPacket(const DataBlock& packet)
|
||||
|
@ -152,7 +152,7 @@ bool SignallingReceiver::control(SignallingInterface::Operation oper, NamedList*
|
|||
m_ifaceMutex.lock();
|
||||
RefPointer<SignallingInterface> tmp = m_interface;
|
||||
m_ifaceMutex.unlock();
|
||||
return tmp && tmp->control(oper,params);
|
||||
return TelEngine::controlReturn(params,tmp && tmp->control(oper,params));
|
||||
}
|
||||
|
||||
bool SignallingReceiver::transmitPacket(const DataBlock& packet, bool repeat,
|
||||
|
|
|
@ -4074,7 +4074,7 @@ bool SS7ISUP::control(NamedList& params)
|
|||
return false;
|
||||
Lock mylock(this);
|
||||
if (!m_remotePoint)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
unsigned int code1 = 1;
|
||||
if (circuits()) {
|
||||
ObjList* o = circuits()->circuits().skipNull();
|
||||
|
@ -4094,7 +4094,7 @@ bool SS7ISUP::control(NamedList& params)
|
|||
mylock.drop();
|
||||
transmitMessage(msg,label,false);
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgISUP::CQM:
|
||||
{
|
||||
unsigned int code = params.getIntValue(YSTRING("circuit"),code1);
|
||||
|
@ -4105,7 +4105,7 @@ bool SS7ISUP::control(NamedList& params)
|
|||
mylock.drop();
|
||||
transmitMessage(msg,label,false);
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgISUP::CCR:
|
||||
{
|
||||
unsigned int code = params.getIntValue(YSTRING("circuit"),code1);
|
||||
|
@ -4123,25 +4123,25 @@ bool SS7ISUP::control(NamedList& params)
|
|||
mylock.drop();
|
||||
transmitMessage(msg,label,false);
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgISUP::RSC:
|
||||
if (0 == (m_rscSpeedup = circuits() ? circuits()->count() : 0))
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,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;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgISUP::BLK:
|
||||
case SS7MsgISUP::UBL:
|
||||
return handleCicBlockCommand(params,cmd == SS7MsgISUP::BLK);
|
||||
return TelEngine::controlReturn(¶ms,handleCicBlockCommand(params,cmd == SS7MsgISUP::BLK));
|
||||
case SS7MsgISUP::RLC:
|
||||
{
|
||||
int code = params.getIntValue(YSTRING("circuit"));
|
||||
if (code <= 0)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
SignallingMessageTimer* pending = findPendingMessage(SS7MsgISUP::RSC,code,true);
|
||||
if (pending) {
|
||||
resetCircuit((unsigned int)code,false,false);
|
||||
|
@ -4154,12 +4154,12 @@ bool SS7ISUP::control(NamedList& params)
|
|||
RefPointer<SS7ISUPCall> call;
|
||||
findCall(code,call);
|
||||
if (!call)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
mylock.drop();
|
||||
call->setTerminate(true,params.getValue(YSTRING("reason"),"normal"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgISUP::UPA:
|
||||
if (!m_userPartAvail) {
|
||||
const char* oldStat = statusName();
|
||||
|
@ -4176,13 +4176,13 @@ bool SS7ISUP::control(NamedList& params)
|
|||
engine()->notify(this,params);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgISUP::CtrlSave:
|
||||
setVerify(true,true);
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
#ifdef ISUP_HANDLE_CIC_EVENT_CONTROL
|
||||
case SS7MsgISUP::CtrlCicEvent:
|
||||
return handleCicEventCommand(params);
|
||||
return TelEngine::controlReturn(¶ms,handleCicEventCommand(params));
|
||||
#endif
|
||||
}
|
||||
mylock.drop();
|
||||
|
|
|
@ -254,7 +254,7 @@ bool SS7Layer2::control(NamedList& params)
|
|||
}
|
||||
if (!(cmp && toString() == cmp))
|
||||
return false;
|
||||
return (cmd >= 0) && control((Operation)cmd,¶ms);
|
||||
return TelEngine::controlReturn(¶ms,(cmd >= 0) && control((Operation)cmd,¶ms));
|
||||
}
|
||||
|
||||
bool SS7Layer2::getEmergency(NamedList* params, bool emg) const
|
||||
|
@ -433,16 +433,16 @@ bool SS7MTP2::control(Operation oper, NamedList* params)
|
|||
switch (oper) {
|
||||
case Pause:
|
||||
abortAlignment(false);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Resume:
|
||||
if (aligned() || !m_autostart)
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
// fall-through
|
||||
case Align:
|
||||
startAlignment(getEmergency(params));
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Status:
|
||||
return operational();
|
||||
return TelEngine::controlReturn(params,operational());
|
||||
default:
|
||||
return SignallingReceiver::control((SignallingInterface::Operation)oper,params);
|
||||
}
|
||||
|
|
|
@ -850,7 +850,7 @@ bool SS7MTP3::control(Operation oper, NamedList* params)
|
|||
if (ok)
|
||||
SS7Layer3::notify(-1);
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Restart:
|
||||
if (ok) {
|
||||
ok = false;
|
||||
|
@ -877,12 +877,12 @@ bool SS7MTP3::control(Operation oper, NamedList* params)
|
|||
}
|
||||
Debug(this,DebugNote,"Emergency resume attempt on %u links [%p]",cnt,this);
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Status:
|
||||
printRoutes();
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);;
|
||||
}
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
}
|
||||
|
||||
bool SS7MTP3::control(NamedList& params)
|
||||
|
|
|
@ -841,13 +841,13 @@ bool SS7Management::control(NamedList& params)
|
|||
unsigned char data[5];
|
||||
int len = SS7PointCode::length(t)+1;
|
||||
data[0] = cmd;
|
||||
return dest.store(t,data+1,spare) &&
|
||||
return TelEngine::controlReturn(¶ms,dest.store(t,data+1,spare) &&
|
||||
((cmd == SS7MsgSNM::TFP) ?
|
||||
postpone(new SS7MSU(txSio,lbl,data,len),lbl,txSls,1000) :
|
||||
(transmitMSU(SS7MSU(txSio,lbl,data,len),lbl,txSls) >= 0));
|
||||
(transmitMSU(SS7MSU(txSio,lbl,data,len),lbl,txSls) >= 0)));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
// Messages sent with just the code
|
||||
case SS7MsgSNM::ECO:
|
||||
case SS7MsgSNM::TRA:
|
||||
|
@ -862,19 +862,19 @@ bool SS7Management::control(NamedList& params)
|
|||
case SS7MsgSNM::CNP:
|
||||
{
|
||||
unsigned char data = cmd;
|
||||
return transmitMSU(SS7MSU(txSio,lbl,&data,1),lbl,txSls) >= 0;
|
||||
return TelEngine::controlReturn(¶ms,transmitMSU(SS7MSU(txSio,lbl,&data,1),lbl,txSls) >= 0);
|
||||
}
|
||||
// Messages postponed with just the code
|
||||
case SS7MsgSNM::LIN:
|
||||
{
|
||||
unsigned char data = cmd;
|
||||
return postpone(new SS7MSU(txSio,lbl,&data,1),lbl,txSls,2500,5000);
|
||||
return TelEngine::controlReturn(¶ms,postpone(new SS7MSU(txSio,lbl,&data,1),lbl,txSls,2500,5000));
|
||||
}
|
||||
case SS7MsgSNM::LUN:
|
||||
case SS7MsgSNM::LFU:
|
||||
{
|
||||
unsigned char data = cmd;
|
||||
return postpone(new SS7MSU(txSio,lbl,&data,1),lbl,txSls,1200,2400);
|
||||
return TelEngine::controlReturn(¶ms,postpone(new SS7MSU(txSio,lbl,&data,1),lbl,txSls,1200,2400));
|
||||
}
|
||||
// Changeover messages
|
||||
case SS7MsgSNM::COO:
|
||||
|
@ -883,7 +883,7 @@ bool SS7Management::control(NamedList& params)
|
|||
case SS7MsgSNM::XCA:
|
||||
if (params.getBoolValue(YSTRING("emergency"),false)) {
|
||||
unsigned char data = (SS7MsgSNM::COO == cmd) ? SS7MsgSNM::ECO : SS7MsgSNM::ECA;
|
||||
return transmitMSU(SS7MSU(txSio,lbl,&data,1),lbl,txSls) >= 0;
|
||||
return TelEngine::controlReturn(¶ms,transmitMSU(SS7MSU(txSio,lbl,&data,1),lbl,txSls) >= 0);
|
||||
}
|
||||
else {
|
||||
int seq = params.getIntValue(YSTRING("sequence"),0) & 0x00ffffff;
|
||||
|
@ -913,11 +913,11 @@ bool SS7Management::control(NamedList& params)
|
|||
break;
|
||||
default:
|
||||
Debug(DebugStub,"Please implement COO for type %u",t);
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
return (cmd == SS7MsgSNM::COA)
|
||||
return TelEngine::controlReturn(¶ms,(cmd == SS7MsgSNM::COA)
|
||||
? transmitMSU(SS7MSU(txSio,lbl,&data,len),lbl,txSls) >= 0
|
||||
: postpone(new SS7MSU(txSio,lbl,&data,len),lbl,txSls,1800,0,true);
|
||||
: postpone(new SS7MSU(txSio,lbl,&data,len),lbl,txSls,1800,0,true));
|
||||
}
|
||||
// Changeback messages
|
||||
case SS7MsgSNM::CBD:
|
||||
|
@ -938,11 +938,11 @@ bool SS7Management::control(NamedList& params)
|
|||
break;
|
||||
default:
|
||||
Debug(DebugStub,"Please implement CBD for type %u",t);
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
return (cmd == SS7MsgSNM::CBA)
|
||||
return TelEngine::controlReturn(¶ms,(cmd == SS7MsgSNM::CBA)
|
||||
? transmitMSU(SS7MSU(txSio,lbl,&data,len),lbl,txSls) >= 0
|
||||
: postpone(new SS7MSU(txSio,lbl,&data,len),lbl,txSls,1000,2000,true);
|
||||
: postpone(new SS7MSU(txSio,lbl,&data,len),lbl,txSls,1000,2000,true));
|
||||
}
|
||||
default:
|
||||
if (cmd >= 0)
|
||||
|
@ -952,7 +952,7 @@ bool SS7Management::control(NamedList& params)
|
|||
}
|
||||
}
|
||||
TelEngine::destruct(l);
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
|
||||
void SS7Management::notify(SS7Layer3* network, int sls)
|
||||
|
|
|
@ -69,6 +69,7 @@ static const TokenDict s_dict_control[] = {
|
|||
{ "show", SS7Router::Status },
|
||||
{ "pause", SS7Router::Pause },
|
||||
{ "resume", SS7Router::Resume },
|
||||
{ "restart", SS7Router::Restart },
|
||||
{ "traffic", SS7Router::Traffic },
|
||||
{ "advertise", SS7Router::Advertise },
|
||||
{ "prohibit", SS7MsgSNM::TFP },
|
||||
|
@ -1871,13 +1872,13 @@ bool SS7Router::control(NamedList& params)
|
|||
switch (cmd) {
|
||||
case SS7Router::Pause:
|
||||
disable();
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7Router::Resume:
|
||||
if (m_started || m_restart.started())
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
// fall through
|
||||
case SS7Router::Restart:
|
||||
return restart();
|
||||
return TelEngine::controlReturn(¶ms,restart());
|
||||
case SS7Router::Traffic:
|
||||
if (!m_trafficSent.started())
|
||||
m_trafficSent.start();
|
||||
|
@ -1886,16 +1887,16 @@ bool SS7Router::control(NamedList& params)
|
|||
case SS7Router::Status:
|
||||
printRoutes();
|
||||
printStats();
|
||||
return operational();
|
||||
return TelEngine::controlReturn(¶ms,operational());
|
||||
case SS7Router::Advertise:
|
||||
if (!(m_transfer && (m_started || m_phase2)))
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
notifyRoutes();
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case SS7MsgSNM::RST:
|
||||
case SS7MsgSNM::RSR:
|
||||
if (!m_started)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
// fall through
|
||||
case SS7MsgSNM::TRA:
|
||||
case SS7MsgSNM::TFP:
|
||||
|
@ -1932,25 +1933,25 @@ bool SS7Router::control(NamedList& params)
|
|||
TelEngine::destruct(l);
|
||||
SS7Route::State state = getRouteView(type,pc.pack(type),opc.pack(type));
|
||||
if (SS7Route::Unknown == state)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
if (routeState(static_cast<SS7MsgSNM::Type>(cmd)) == state)
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
// a route state changed, advertise to the adjacent node
|
||||
if (!(m_transfer && m_started && m_mngmt))
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
const char* oper = lookup(state,s_dict_states);
|
||||
if (!oper)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
NamedList* ctl = m_mngmt->controlCreate(oper);
|
||||
if (!ctl)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
Debug(this,DebugInfo,"Requesting %s %s to %s [%p]",
|
||||
dest->c_str(),oper,addr->c_str(),this);
|
||||
ctl->addParam("address",addr->c_str());
|
||||
ctl->addParam("destination",*dest);
|
||||
ctl->setParam("automatic",String::boolText(true));
|
||||
m_mngmt->controlExecute(ctl);
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
}
|
||||
String src = params.getParam(YSTRING("source"));
|
||||
if (src.null()) {
|
||||
|
@ -1991,7 +1992,7 @@ bool SS7Router::control(NamedList& params)
|
|||
sendRestart(type,pc.pack(type));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
}
|
||||
break;
|
||||
case -1:
|
||||
|
@ -2002,7 +2003,7 @@ bool SS7Router::control(NamedList& params)
|
|||
}
|
||||
if (err)
|
||||
Debug(this,DebugWarn,"Control error: %s [%p]",err.c_str(),this);
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
|
||||
void SS7Router::printStats()
|
||||
|
|
|
@ -4401,27 +4401,27 @@ bool SS7SCCP::control(NamedList& params)
|
|||
switch (cmd) {
|
||||
case Status:
|
||||
printStatus(false);
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case FullStatus:
|
||||
if (m_extendedMonitoring)
|
||||
printStatus(true);
|
||||
else
|
||||
Output("Extended monitoring disabled!! Full Status unavailable!");
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case EnableExtendedMonitoring:
|
||||
m_extendedMonitoring = true;
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case DisableExtendedMonitoring:
|
||||
m_extendedMonitoring = false;
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case EnablePrintMsg:
|
||||
m_printMsg = true;
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case DisablePrintMsg:
|
||||
m_printMsg = false;
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
|
||||
void SS7SCCP::printStatus(bool extended)
|
||||
|
|
|
@ -183,6 +183,9 @@ void SIGTRAN::attach(SIGTransport* trans)
|
|||
}
|
||||
if (trans) {
|
||||
trans->attach(this);
|
||||
SignallingEngine* engine = SignallingEngine::self();
|
||||
if (engine)
|
||||
engine->insert(trans);
|
||||
trans->deref();
|
||||
}
|
||||
}
|
||||
|
@ -1416,7 +1419,7 @@ bool SS7M2PA::control(NamedList& params)
|
|||
}
|
||||
if (!(cmp && toString() == cmp))
|
||||
return false;
|
||||
return (cmd >= 0) && control((M2PAOperations)cmd,¶ms);
|
||||
return TelEngine::controlReturn(¶ms,(cmd >= 0) && control((M2PAOperations)cmd,¶ms));
|
||||
}
|
||||
|
||||
bool SS7M2PA::control(M2PAOperations oper, NamedList* params)
|
||||
|
@ -1433,22 +1436,22 @@ bool SS7M2PA::control(M2PAOperations oper, NamedList* params)
|
|||
m_state = OutOfService;
|
||||
abortAlignment("Control request pause.");
|
||||
transmitLS();
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Resume:
|
||||
if (aligned() || !m_autostart)
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Align:
|
||||
{
|
||||
m_state = getEmergency(params) ? ProvingEmergency : ProvingNormal;
|
||||
abortAlignment("Control request align.");
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
}
|
||||
case Status:
|
||||
return operational();
|
||||
return TelEngine::controlReturn(params,operational());
|
||||
case TransRestart:
|
||||
return restart(true);
|
||||
return TelEngine::controlReturn(params,restart(true));
|
||||
default:
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1949,22 +1952,22 @@ bool SS7M2UA::control(Operation oper, NamedList* params)
|
|||
SIGAdaptation::addTag(buf,0x0001,(u_int32_t)m_iid);
|
||||
// Release Request
|
||||
if (!adaptation()->transmitMSG(SIGTRAN::MAUP,4,buf,getStreamId()))
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
getSequence();
|
||||
}
|
||||
m_linkState = LinkDown;
|
||||
if (!m_retrieve.started())
|
||||
SS7Layer2::notify();
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Resume:
|
||||
if (operational())
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
if (!m_autostart)
|
||||
return activate();
|
||||
return TelEngine::controlReturn(params,activate());
|
||||
if (m_retrieve.started()) {
|
||||
if (LinkDown == m_linkState)
|
||||
m_linkState = getEmergency(params,false) ? LinkReqEmg : LinkReq;
|
||||
return activate();
|
||||
return TelEngine::controlReturn(params,activate());
|
||||
}
|
||||
// fall through
|
||||
case Align:
|
||||
|
@ -1982,18 +1985,19 @@ bool SS7M2UA::control(Operation oper, NamedList* params)
|
|||
SIGAdaptation::addTag(buf,0x0302,(emg ? 2 : 3));
|
||||
// State Request
|
||||
if (!adaptation()->transmitMSG(SIGTRAN::MAUP,7,buf,getStreamId()))
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
buf.clear();
|
||||
if (m_iid >= 0)
|
||||
SIGAdaptation::addTag(buf,0x0001,(u_int32_t)m_iid);
|
||||
// Establish Request
|
||||
return adaptation()->transmitMSG(SIGTRAN::MAUP,2,buf,getStreamId());
|
||||
return TelEngine::controlReturn(params,
|
||||
adaptation()->transmitMSG(SIGTRAN::MAUP,2,buf,getStreamId()));
|
||||
}
|
||||
return activate();
|
||||
return TelEngine::controlReturn(params,activate());
|
||||
case Status:
|
||||
return operational();
|
||||
return TelEngine::controlReturn(params,operational());
|
||||
default:
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -166,21 +166,21 @@ bool SS7Testing::control(NamedList& params)
|
|||
switch (cmd) {
|
||||
case CMD_STOP:
|
||||
m_timer.stop();
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
case CMD_START:
|
||||
if (!(m_timer.interval() && m_lbl.length()))
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
m_timer.start();
|
||||
return sendTraffic();
|
||||
return TelEngine::controlReturn(¶ms,sendTraffic());
|
||||
case CMD_SINGLE:
|
||||
if (!m_lbl.length())
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
m_timer.stop();
|
||||
return sendTraffic();
|
||||
return TelEngine::controlReturn(¶ms,sendTraffic());
|
||||
case CMD_RESET:
|
||||
m_timer.stop();
|
||||
m_lbl.assign(SS7PointCode::Other,m_lbl.opc(),m_lbl.dpc(),m_lbl.sls());
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶ms,true);
|
||||
}
|
||||
}
|
||||
return SignallingComponent::control(params);
|
||||
|
|
|
@ -334,7 +334,7 @@ bool AmrEncoder::control(NamedList& params)
|
|||
m_cmr = (Mode)mode;
|
||||
ok = true;
|
||||
}
|
||||
return AmrTrans::control(params) || ok;
|
||||
return TelEngine::controlReturn(¶ms,AmrTrans::control(params) || ok);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -614,12 +614,12 @@ bool CoreAudioSource::control(NamedList& params)
|
|||
{
|
||||
DDebug(DebugAll,"CoreAudioSource::control() [%p]",this);
|
||||
if (!m_volSettable)
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
int vol = params.getIntValue("in_volume",-1);
|
||||
if (vol == -1) {
|
||||
Debug(DebugAll,"CoreAudioSource::control() [%p] - invalid value to set for volume",this);
|
||||
return false;
|
||||
}
|
||||
return TelEngine::controlReturn(params,false);
|
||||
}
|
||||
Float32 volValue = vol / 100.0;
|
||||
|
||||
bool setVolStatus = false;
|
||||
|
@ -650,8 +650,8 @@ bool CoreAudioSource::control(NamedList& params)
|
|||
Debug(DebugAll,"CoreAudioSource::control() [%p] - set volume failed on all channels",this);
|
||||
|
||||
if(params.getParam("out_volume"))
|
||||
return false;
|
||||
return setVolStatus;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
return TelEngine::controlReturn(params,setVolStatus);
|
||||
}
|
||||
|
||||
|
||||
|
@ -836,11 +836,11 @@ bool CoreAudioConsumer::control(NamedList& params)
|
|||
{
|
||||
DDebug(DebugAll,"CoreAudioConsumer::control() [%p]",this);
|
||||
if (!m_volSettable)
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
int vol = params.getIntValue("out_volume",-1);
|
||||
if (vol == -1) {
|
||||
Debug(DebugAll,"CoreAudioConsumer::control() [%p] invalid value to set for volume",this);
|
||||
return false;
|
||||
Debug(DebugAll,"CoreAudioConsumer::control() [%p] invalid value to set for volume",this);
|
||||
return TelEngine::controlReturn(¶ms,false);
|
||||
}
|
||||
Float32 volValue = vol / 100.0;
|
||||
|
||||
|
@ -872,7 +872,7 @@ bool CoreAudioConsumer::control(NamedList& params)
|
|||
if (!setVolStatus)
|
||||
Debug(DebugAll,"CoreAudioConsumer::control() [%p] - set volume failed on all channels",this);
|
||||
|
||||
return setVolStatus;
|
||||
return TelEngine::controlReturn(params,setVolStatus);
|
||||
}
|
||||
|
||||
CoreAudioChan::CoreAudioChan(const String& dev, unsigned int rate)
|
||||
|
|
|
@ -394,7 +394,7 @@ bool DSoundPlay::control(NamedList& msg)
|
|||
outValue = 0;
|
||||
msg.setParam("out_volume", String(outValue));
|
||||
}
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);
|
||||
}
|
||||
|
||||
void DSoundPlay::cleanup()
|
||||
|
@ -592,7 +592,7 @@ bool DSoundRec::control(TelEngine::NamedList &msg)
|
|||
|
||||
inValue = (10 - m_rshift) * 10;
|
||||
msg.setParam("in_volume", String(inValue));
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);
|
||||
}
|
||||
|
||||
|
||||
|
@ -615,7 +615,7 @@ bool DSoundSource::control(NamedList& msg)
|
|||
{
|
||||
if (m_dsound)
|
||||
return m_dsound->control(msg);
|
||||
return false;
|
||||
return TelEngine::controlReturn(params,false);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1019,7 +1019,7 @@ bool ConfConsumer::control(NamedList& msg)
|
|||
m_smart = param->toBoolean();
|
||||
ok = true;
|
||||
}
|
||||
return DataConsumer::control(msg) || ok;
|
||||
return TelEngine::controlReturn(&msg,DataConsumer::control(msg) || ok);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4466,33 +4466,34 @@ bool JBModule::handleClusterControl(Message& msg)
|
|||
Debug(this,DebugAll,"Handling cluster control oper=%s",oper.c_str());
|
||||
// Send yate message
|
||||
if (oper == "send")
|
||||
return s_jabber->sendCluster(msg,&s_clusterControlSkip);
|
||||
return TelEngine::controlReturn(&msg,
|
||||
s_jabber->sendCluster(msg,&s_clusterControlSkip));
|
||||
// Start/stop listener
|
||||
if (oper == "listen") {
|
||||
String name = msg.getValue("name","cluster");
|
||||
if (msg.getBoolValue("enable")) {
|
||||
NamedList p(msg);
|
||||
p.setParam("type",lookup(JBStream::cluster,JBStream::s_typeName));
|
||||
return buildListener(name,p);
|
||||
return TelEngine::controlReturn(&msg,buildListener(name,p));
|
||||
}
|
||||
cancelListener(name);
|
||||
return false;
|
||||
return TelEngine::controlReturn(&msg,false);
|
||||
}
|
||||
// Start/stop node connection
|
||||
if (oper == "connect") {
|
||||
const String& node = msg["node"];
|
||||
if (!node)
|
||||
return false;
|
||||
return TelEngine::controlReturn(&msg,false);
|
||||
bool enable = msg.getBoolValue("enable");
|
||||
JBClusterStream* s = s_jabber->getClusterStream(node,msg,enable);
|
||||
if (!s)
|
||||
return false;
|
||||
return TelEngine::controlReturn(&msg,false);
|
||||
if (!enable)
|
||||
s->terminate(-1,true,0,XMPPError::NoError,msg.getValue("reason","dropped"));
|
||||
TelEngine::destruct(s);
|
||||
return true;
|
||||
return TelEngine::controlReturn(&msg,true);
|
||||
}
|
||||
return false;
|
||||
return TelEngine::controlReturn(&msg,false);
|
||||
}
|
||||
|
||||
// Build a listener from a list of parameters. Add it to the list and start it
|
||||
|
|
|
@ -1361,6 +1361,7 @@ bool Connection::processLine(const char *line, bool saveLine)
|
|||
Message m("chan.control");
|
||||
m.addParam("targetid",id);
|
||||
m.addParam("component",id);
|
||||
m.addParam("module","rmanager");
|
||||
static const Regexp r("^\\(.* \\)\\?\\([^= ]\\+\\)=\\([^=]*\\)$");
|
||||
while (ctrl) {
|
||||
if (!ctrl.matches(r)) {
|
||||
|
@ -1371,10 +1372,24 @@ bool Connection::processLine(const char *line, bool saveLine)
|
|||
ctrl = ctrl.matchString(1).trimBlanks();
|
||||
}
|
||||
if (Engine::dispatch(m)) {
|
||||
if (m_machine)
|
||||
str = "%%=control:success:" + id + ":" + m.retValue() + "\r\n";
|
||||
NamedString* opStatus = m.getParam(YSTRING("operation-status"));
|
||||
String retVal;
|
||||
String* stringRet = m.getParam(YSTRING("retVal"));
|
||||
if (stringRet)
|
||||
retVal = *stringRet;
|
||||
else
|
||||
str = "Control '" + id + "' " + m.retValue().safe("OK") + "\r\n";
|
||||
retVal = m.retValue();
|
||||
if (!opStatus || opStatus->toBoolean()) {
|
||||
if (m_machine)
|
||||
str = "%%=control:success:" + id + ":" + retVal + "\r\n";
|
||||
else
|
||||
str = "Control '" + id + "' " + retVal.safe("OK") + "\r\n";
|
||||
} else {
|
||||
if (m_machine)
|
||||
str = "%%=control:error:" + id + ":" + retVal + "\r\n";
|
||||
else
|
||||
str = "Control '" + id + "' " + retVal.safe("FAILED") + "\r\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
str = (m_machine ? "%%=control:fail:" : "Could not control ") + str + "\r\n";
|
||||
|
|
|
@ -1708,10 +1708,10 @@ bool SLT::control(Operation oper, NamedList* params)
|
|||
case Pause:
|
||||
setReqStatus(OutOfService);
|
||||
sendManagement(Disconnect_R);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Resume:
|
||||
if (aligned() || !m_autostart)
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
// fall through
|
||||
case Align:
|
||||
{
|
||||
|
@ -1727,9 +1727,9 @@ bool SLT::control(Operation oper, NamedList* params)
|
|||
configure(true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Status:
|
||||
return aligned() && m_status == Configured;
|
||||
return TelEngine::controlReturn(params,aligned() && m_status == Configured);
|
||||
default:
|
||||
return false;//SignallingReceiver::control((SignallingInterface::Operation)oper,params);
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ public:
|
|||
void initialize(const Configuration& params);
|
||||
inline void requestExit()
|
||||
{ m_exit = true; }
|
||||
bool update(const Message& msg);
|
||||
bool update(Message& msg);
|
||||
inline Cpu* getCpu()
|
||||
{ return m_cpu; }
|
||||
private:
|
||||
|
@ -279,35 +279,41 @@ void CpuUpdater::setCpu(Cpu* cpu)
|
|||
}
|
||||
|
||||
// This method appends a target from chan.control message
|
||||
bool CpuUpdater::update(const Message& msg)
|
||||
bool CpuUpdater::update(Message& msg)
|
||||
{
|
||||
String mon = msg.getValue("operation","");
|
||||
NamedString* inc = 0;
|
||||
for (unsigned int i = 0;i < msg.count();i++) {
|
||||
NamedString* ns = msg.getParam(i);
|
||||
if (ns->name() == "operation" || ns->name() == "component" ||
|
||||
ns->name() == "targetid")
|
||||
if (!ns->name().startsWith("cpu.") || ns->name().length() <= 4)
|
||||
continue;
|
||||
inc = ns;
|
||||
inc = new NamedString(ns->name().substr(4),*ns);
|
||||
}
|
||||
if (!inc) {
|
||||
DDebug(&s_module,DebugNote,"No target parameter for monitor %s",mon.c_str());
|
||||
return false;
|
||||
TelEngine::destruct(inc);
|
||||
return TelEngine::controlReturn(&msg,true);
|
||||
}
|
||||
Lock lock(this);
|
||||
bool ret = false;
|
||||
switch (lookup(mon,s_monitors,Unknown)) {
|
||||
case YateUser:
|
||||
return m_yateUser.addTarget(*inc,m_oscillationTimer);
|
||||
ret = m_yateUser.addTarget(*inc,m_oscillationTimer);
|
||||
break;
|
||||
case YateKernel:
|
||||
return m_yateSys.addTarget(*inc,m_oscillationTimer);
|
||||
ret = m_yateSys.addTarget(*inc,m_oscillationTimer);
|
||||
break;
|
||||
case YateTotal:
|
||||
return m_yateTotal.addTarget(*inc,m_oscillationTimer);
|
||||
ret = m_yateTotal.addTarget(*inc,m_oscillationTimer);
|
||||
break;
|
||||
case System:
|
||||
return m_system.addTarget(*inc,m_oscillationTimer);
|
||||
ret = m_system.addTarget(*inc,m_oscillationTimer);
|
||||
break;
|
||||
default:
|
||||
Debug(&s_module,DebugNote,"Unknown cpu monitor %s",mon.c_str());
|
||||
}
|
||||
return false;
|
||||
TelEngine::destruct(inc);
|
||||
return TelEngine::controlReturn(&msg,ret);
|
||||
}
|
||||
|
||||
void CpuUpdater::initialize(const Configuration& params)
|
||||
|
|
|
@ -206,7 +206,7 @@ public:
|
|||
bool addSocket(Socket* socket,SocketAddr& adress);
|
||||
virtual bool reliable() const
|
||||
{ return m_type == Sctp || m_type == Tcp; }
|
||||
virtual bool control(const NamedList ¶m);
|
||||
virtual bool control(NamedList ¶m);
|
||||
virtual bool connected(int id) const
|
||||
{ return m_state == Up;}
|
||||
virtual void attached(bool ual)
|
||||
|
@ -665,6 +665,7 @@ Transport::~Transport()
|
|||
|
||||
void Transport::destroyed()
|
||||
{
|
||||
SignallingComponent::destroyed();
|
||||
m_readerMutex.lock();
|
||||
TReader* tmp = m_reader;
|
||||
m_reader = 0;
|
||||
|
@ -686,22 +687,29 @@ void Transport::resetReader(TReader* caller)
|
|||
TelEngine::destruct(caller);
|
||||
}
|
||||
|
||||
bool Transport::control(const NamedList ¶m)
|
||||
bool Transport::control(NamedList& param)
|
||||
{
|
||||
String cmp = param.getValue(YSTRING("component"));
|
||||
if (!cmp)
|
||||
return false;
|
||||
if (cmp.startsWith(YSTRING("Transport:")) && cmp != toString())
|
||||
return false;
|
||||
if (toString() != String("Transport:" + cmp))
|
||||
return false;
|
||||
String oper = param.getValue(YSTRING("operation"),YSTRING("init"));
|
||||
if (oper == YSTRING("init"))
|
||||
return initialize(¶m);
|
||||
return TelEngine::controlReturn(¶m,initialize(¶m));
|
||||
else if (oper == YSTRING("add_addr")) {
|
||||
if (!m_listener) {
|
||||
Debug(this,DebugWarn,"Unable to listen on another address, listener is missing");
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶m,false);
|
||||
}
|
||||
return m_listener->addAddress(param);
|
||||
return TelEngine::controlReturn(¶m,m_listener->addAddress(param));
|
||||
} else if (oper == YSTRING("reconnect")) {
|
||||
reconnect(true);
|
||||
return true;
|
||||
return TelEngine::controlReturn(¶m,true);
|
||||
}
|
||||
return false;
|
||||
return TelEngine::controlReturn(¶m,false);
|
||||
}
|
||||
|
||||
void Transport::reconnect(bool force)
|
||||
|
|
|
@ -1876,19 +1876,19 @@ bool TdmInterface::control(Operation oper, NamedList* params)
|
|||
case EnableTx:
|
||||
case DisableTx:
|
||||
if (m_readOnly == (oper == DisableTx))
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
m_readOnly = (oper == DisableTx);
|
||||
m_sendReadOnly = false;
|
||||
Debug(this,DebugInfo,"Tx is %sabled [%p]",m_readOnly?"dis":"en",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Query:
|
||||
return valid();
|
||||
return TelEngine::controlReturn(params,valid());
|
||||
default:
|
||||
return SignallingInterface::control(oper,params);
|
||||
}
|
||||
if (oper == Enable) {
|
||||
if (valid())
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
m_device.setInterfaceName(m_ifname);
|
||||
bool ok = m_device.valid()|| m_device.makeConnection();
|
||||
if (ok) {
|
||||
|
@ -1902,7 +1902,7 @@ bool TdmInterface::control(Operation oper, NamedList* params)
|
|||
Debug(this,DebugWarn,"Enable failed [%p]",this);
|
||||
control(Disable,0);
|
||||
}
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);
|
||||
}
|
||||
// oper is Disable
|
||||
bool ok = valid();
|
||||
|
@ -1911,7 +1911,7 @@ bool TdmInterface::control(Operation oper, NamedList* params)
|
|||
m_device.close();
|
||||
if (ok)
|
||||
Debug(this,DebugAll,"Disabled [%p]",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1035,13 +1035,13 @@ bool WpInterface::control(Operation oper, NamedList* params)
|
|||
case EnableTx:
|
||||
case DisableTx:
|
||||
if (m_readOnly == (oper == DisableTx))
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
m_readOnly = (oper == DisableTx);
|
||||
m_sendReadOnly = false;
|
||||
Debug(this,DebugInfo,"Tx is %sabled [%p]",m_readOnly?"dis":"en",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Query:
|
||||
return m_socket.valid() && m_thread && m_thread->running();
|
||||
return TelEngine::controlReturn(params,m_socket.valid() && m_thread && m_thread->running());
|
||||
default:
|
||||
return SignallingInterface::control(oper,params);
|
||||
}
|
||||
|
@ -1063,7 +1063,7 @@ bool WpInterface::control(Operation oper, NamedList* params)
|
|||
Debug(this,DebugWarn,"Enable failed [%p]",this);
|
||||
control(Disable,0);
|
||||
}
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);
|
||||
}
|
||||
// oper is Disable
|
||||
m_timerRxUnder.stop();
|
||||
|
@ -1074,7 +1074,7 @@ bool WpInterface::control(Operation oper, NamedList* params)
|
|||
}
|
||||
m_socket.close();
|
||||
DDebug(this,DebugAll,"Disabled [%p]",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
}
|
||||
|
||||
// Update link status. Notify the receiver if state changed
|
||||
|
|
|
@ -656,13 +656,13 @@ bool WpInterface::control(Operation oper, NamedList* params)
|
|||
case EnableTx:
|
||||
case DisableTx:
|
||||
if (m_readOnly == (oper == DisableTx))
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
m_readOnly = (oper == DisableTx);
|
||||
m_sendReadOnly = false;
|
||||
Debug(this,DebugInfo,"Tx is %sabled [%p]",m_readOnly?"dis":"en",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Query:
|
||||
return m_socket.valid() && m_thread && m_thread->running();
|
||||
return TelEngine::controlReturn(params,m_socket.valid() && m_thread && m_thread->running());
|
||||
default:
|
||||
return SignallingInterface::control(oper,params);
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ bool WpInterface::control(Operation oper, NamedList* params)
|
|||
Debug(this,DebugWarn,"Enable failed [%p]",this);
|
||||
control(Disable,0);
|
||||
}
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);
|
||||
}
|
||||
// oper is Disable
|
||||
m_timerRxUnder.stop();
|
||||
|
@ -695,7 +695,7 @@ bool WpInterface::control(Operation oper, NamedList* params)
|
|||
}
|
||||
m_socket.close();
|
||||
DDebug(this,DebugAll,"Disabled [%p]",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
}
|
||||
|
||||
void WpInterface::timerTick(const Time& when)
|
||||
|
|
|
@ -1902,19 +1902,19 @@ bool ZapInterface::control(Operation oper, NamedList* params)
|
|||
case EnableTx:
|
||||
case DisableTx:
|
||||
if (m_readOnly == (oper == DisableTx))
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
m_readOnly = (oper == DisableTx);
|
||||
m_sendReadOnly = false;
|
||||
Debug(this,DebugInfo,"Tx is %sabled [%p]",m_readOnly?"dis":"en",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
case Query:
|
||||
return valid();
|
||||
return TelEngine::controlReturn(params,valid());
|
||||
default:
|
||||
return SignallingInterface::control(oper,params);
|
||||
}
|
||||
if (oper == Enable) {
|
||||
if (valid())
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
bool ok = m_device.valid() || m_device.open(m_numbufs,m_bufsize);
|
||||
if (ok)
|
||||
ok = ZapWorkerClient::start(m_priority,this,debugName());
|
||||
|
@ -1926,7 +1926,7 @@ bool ZapInterface::control(Operation oper, NamedList* params)
|
|||
Debug(this,DebugWarn,"Enable failed [%p]",this);
|
||||
control(Disable,0);
|
||||
}
|
||||
return ok;
|
||||
return TelEngine::controlReturn(params,ok);
|
||||
}
|
||||
// oper is Disable
|
||||
bool ok = valid();
|
||||
|
@ -1935,7 +1935,7 @@ bool ZapInterface::control(Operation oper, NamedList* params)
|
|||
m_device.close();
|
||||
if (ok)
|
||||
Debug(this,DebugAll,"Disabled [%p]",this);
|
||||
return true;
|
||||
return TelEngine::controlReturn(params,true);
|
||||
}
|
||||
|
||||
// Check if received any data in the last interval. Notify receiver
|
||||
|
|
10
yateclass.h
10
yateclass.h
|
@ -2401,6 +2401,16 @@ YATE_API int lookup(const char* str, const TokenDict* tokens, int defvalue = 0,
|
|||
*/
|
||||
YATE_API const char* lookup(int value, const TokenDict* tokens, const char* defvalue = 0);
|
||||
|
||||
class NamedList;
|
||||
|
||||
/**
|
||||
* Utility method to return from a chan.control handler
|
||||
* @param params The parameters list
|
||||
* @param ret The return value
|
||||
* @param retVal The error message
|
||||
* @return ret if the message was not generated from rmanager.
|
||||
*/
|
||||
YATE_API bool controlReturn(NamedList* params, bool ret, const char* retVal = 0);
|
||||
|
||||
/**
|
||||
* A regular expression matching class.
|
||||
|
|
Loading…
Reference in New Issue