本文整理汇总了C++中SipxProcess::disable方法的典型用法代码示例。如果您正苦于以下问题:C++ SipxProcess::disable方法的具体用法?C++ SipxProcess::disable怎么用?C++ SipxProcess::disable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SipxProcess
的用法示例。
在下文中一共展示了SipxProcess::disable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: upgradeFrom3_0
void upgradeFrom3_0()
{
// 3.0 had process definition files in /etc/sipxpbx/process.d
UtlString oldProcessDefinitionDirectory =
SipXecsService::Path(SipXecsService::ConfigurationDirType, "process-old.d");
OsSysLog::add(FAC_SUPERVISOR, PRI_DEBUG,"upgradeFrom3_0: searching '%s'",
oldProcessDefinitionDirectory.data()
);
if ( !OsFileSystem::exists( oldProcessDefinitionDirectory) )
{
return;
}
OsFileIterator definitions(oldProcessDefinitionDirectory);
OsPath oldProcessDefinitionFile;
bool okToRemoveDir = true; // set to false if any pre-4.0 process file cannot be upgraded
for ( OsStatus iteratorStatus = definitions.findFirst(oldProcessDefinitionFile,
OLD_PROCESS_DEFINITION_NAME_PATTERN,
OsFileIterator::FILES);
OS_SUCCESS == iteratorStatus;
iteratorStatus = definitions.findNext(oldProcessDefinitionFile)
)
{
OsPath oldProcessDefinitionPath( oldProcessDefinitionDirectory
+OsPath::separator
+oldProcessDefinitionFile
);
OsSysLog::add(FAC_SUPERVISOR, PRI_INFO,"upgradeFrom3_0: reading pre-4.0 process def '%s'",
oldProcessDefinitionPath.data()
);
// read the process name and the watchdog enable setting,
// and enable the process if necessary
TiXmlDocument processDefinitionDoc(oldProcessDefinitionPath);
bool definitionValid = true;
UtlString errorMsg;
if ( processDefinitionDoc.LoadFile() )
{
TiXmlElement *subroot = processDefinitionDoc.RootElement();
if (subroot != NULL)
{
bool bEnabled=false;
const char *enableString = subroot->Attribute("enable");
if (enableString == NULL || strcmp(enableString, "true")==0)
{
bEnabled=true;
}
TiXmlElement* processDefElement = subroot->FirstChildElement("process_definitions");
if (processDefElement)
{
TiXmlNode *pGroupNode = processDefElement->FirstChild("group");
if (pGroupNode)
{
TiXmlElement *processElement = pGroupNode->FirstChildElement("process");
if (processElement)
{
const char *pMsg = processElement->Attribute("name");
UtlString processName = pMsg;
// enable or disable process based on setting in old process def file
SipxProcess* newProcess;
if ((newProcess=SipxProcessManager::getInstance()->findProcess(processName)))
{
if (bEnabled)
{
OsSysLog::add(FAC_SUPERVISOR, PRI_NOTICE,
"upgradeFrom3_0: enabling process '%s'", processName.data());
newProcess->enable();
}
else
{
OsSysLog::add(FAC_SUPERVISOR, PRI_NOTICE,
"upgradeFrom3_0: disabling process '%s'", processName.data());
newProcess->disable();
}
if (OS_SUCCESS == OsFileSystem::remove(oldProcessDefinitionPath))
{
OsSysLog::add(FAC_SUPERVISOR, PRI_NOTICE,
"upgradeFrom3_0: removing pre-4.0 process def file '%s'",
oldProcessDefinitionPath.data());
}
else
{
OsSysLog::add(FAC_SUPERVISOR, PRI_ERR,
"upgradeFrom3_0: failed to remove pre-4.0 process def file '%s'",
oldProcessDefinitionPath.data());
}
}
else
{
OsSysLog::add(FAC_SUPERVISOR, PRI_ERR,
"upgradeFrom3_0: could not find process '%s'", processName.data());
okToRemoveDir = false;
}
}
//.........这里部分代码省略.........