当前位置: 首页>>代码示例>>C++>>正文


C++ OsConfigDb::getBoolean方法代码示例

本文整理汇总了C++中OsConfigDb::getBoolean方法的典型用法代码示例。如果您正苦于以下问题:C++ OsConfigDb::getBoolean方法的具体用法?C++ OsConfigDb::getBoolean怎么用?C++ OsConfigDb::getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OsConfigDb的用法示例。


在下文中一共展示了OsConfigDb::getBoolean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readConfig

// Read config information.
void SipRedirectorUserParam::readConfig(OsConfigDb& configDb)
{
   mStripAll = configDb.getBoolean( StripAllUserParam, false );
   OsSysLog::add(FAC_SIP, PRI_INFO,
                 "%s::readConfig '%s' = %s",
                 mLogName.data(), StripAllUserParam,
                 mStripAll ? "TRUE" : "FALSE");
}
开发者ID:chemeris,项目名称:sipxecs,代码行数:9,代码来源:SipRedirectorUserParam.cpp

示例2: readConfig

// Read config information.
void SipRedirectorAliasDB::readConfig(OsConfigDb& configDb)
{
   // read the domain configuration
   OsConfigDb domainConfiguration;
   domainConfiguration.loadFromFile(SipXecsService::domainConfigPath());

   // get the shared secret for generating signatures
   SharedSecret secret(domainConfiguration);
   // Set secret for signing SipXauthIdentity
   SipXauthIdentity::setSecret(secret.data());

   UtlString base64;
   NetBase64Codec::encode(secret, base64);
   Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
                 "SipRedirectorAliasDB::readConfig"
                 "%s::readConfig "
                 "set SipXauthIdentity secret",
                 mLogName.data()
                 );

   _enableDiversionHeader =  configDb.getBoolean("SIP_REGISTRAR_ADD_DIVERSION", FALSE);
   _enableEarlyAliasResolution =  configDb.getBoolean("SIP_REGISTRAR_EARLY_ALIAS_RESOLUTION", FALSE);
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:24,代码来源:SipRedirectorAliasDB.cpp

示例3: main

//
// The main entry point to the sipXpark
//
int main(int argc, char* argv[])
{
   // Block all signals in this the main thread.
   // Any threads created from now on will have all signals masked.
   OsTask::blockSignals();

   // Create a new task to wait for signals.  Only that task
   // will ever see a signal from the outside.
   SignalTask* signalTask = new SignalTask();
   signalTask->start();

    // Configuration Database (used for OsSysLog)
    OsConfigDb configDb;

    UtlString argString;
    for(int argIndex = 1; argIndex < argc; argIndex++)
    {
        osPrintf("arg[%d]: %s\n", argIndex, argv[argIndex]);
        argString = argv[argIndex];
        NameValueTokenizer::frontBackTrim(&argString, "\t ");
        if(argString.compareTo("-v") == 0)
        {
            osPrintf("Version: %s (%s)\n", SIPX_VERSION, SIPX_BUILD);
            return(1);
        } else
        {
           osPrintf("usage: %s [-v]\nwhere:\n -v provides the software version\n",
            argv[0]);
            return(1);
        }
    }

    // Load configuration file file
    OsPath workingDirectory;
    if (OsFileSystem::exists(CONFIG_ETC_DIR))
    {
        workingDirectory = CONFIG_ETC_DIR;
        OsPath path(workingDirectory);
        path.getNativePath(workingDirectory);
    } else
    {
        OsPath path;
        OsFileSystem::getWorkingDirectory(path);
        path.getNativePath(workingDirectory);
    }

    UtlString fileName =  workingDirectory +
      OsPathBase::separator +
      CONFIG_SETTINGS_FILE;

    if (configDb.loadFromFile(fileName) != OS_SUCCESS)
    {
       exit(1);
    }

    // Initialize log file
    initSysLog(&configDb);

    // Read the user agent parameters from the config file.
    int UdpPort;
    if (configDb.get(CONFIG_SETTING_UDP_PORT, UdpPort) != OS_SUCCESS)
        UdpPort = PARK_DEFAULT_UDP_PORT;

    int TcpPort;
    if (configDb.get(CONFIG_SETTING_TCP_PORT, TcpPort) != OS_SUCCESS)
        TcpPort = PARK_DEFAULT_TCP_PORT;

    int RtpBase;
    if (configDb.get(CONFIG_SETTING_RTP_PORT, RtpBase) != OS_SUCCESS)
        RtpBase = DEFAULT_RTP_PORT;

    UtlString bindIp;
    if (configDb.get(CONFIG_SETTING_BIND_IP, bindIp) != OS_SUCCESS ||
            !OsSocket::isIp4Address(bindIp))
        bindIp = PARK_DEFAULT_BIND_IP;

    int MaxSessions;
    if (configDb.get(CONFIG_SETTING_MAX_SESSIONS, MaxSessions) != OS_SUCCESS)
    {
        MaxSessions = DEFAULT_MAX_SESSIONS;
    }

    UtlBoolean OneButtonBLF =
       configDb.getBoolean(CONFIG_SETTING_ONE_BUTTON_BLF, DEFAULT_ONE_BUTTON_BLF);

    UtlString   domain;
    UtlString   realm;
    UtlString   user;

    SipLine*    line = NULL;
    SipLineMgr* lineMgr = NULL;

    OsConfigDb  domainConfiguration;
    OsPath      domainConfigPath = SipXecsService::domainConfigPath();

    if (OS_SUCCESS == domainConfiguration.loadFromFile(domainConfigPath.data()))
    {
//.........这里部分代码省略.........
开发者ID:astubbs,项目名称:sipxecs,代码行数:101,代码来源:main.cpp

示例4: readConfig

// Read config information.
void SipRedirectorJoin::readConfig(OsConfigDb& configDb)
{
   // The return status.
   // It will be OS_SUCCESS if this redirector is configured to do any work,
   // and OS_FAILED if not.
   mRedirectorActive = OS_FAILED;

   // Fetch the configuration parameters for the workaround features.
   // Defaults are set to match the previous behavior of the code.

   // One-second subscriptions.
   mOneSecondSubscription = configDb.getBoolean(CONFIG_SETTING_1_SEC, TRUE);
   Os::Logger::instance().log(FAC_SIP, PRI_INFO,
                 "%s::readConfig mOneSecondSubscription = %d",
                 mLogName.data(), mOneSecondSubscription);

   // Fetch the call join festure code from the config file.
   // If it is null, it doesn't count.
   if ((configDb.get(CONFIG_SETTING_JOIN_CODE, mCallJoinCode) !=
        OS_SUCCESS) ||
       mCallJoinCode.isNull())
   {
      Os::Logger::instance().log(FAC_SIP, PRI_INFO,
                    "%s::readConfig No call join feature code specified",
                    mLogName.data());
   }
   else
   {
      // Call join feature code is configured.
      // Initialize the system.
      Os::Logger::instance().log(FAC_SIP, PRI_INFO,
                    "%s::readConfig Call join feature code is '%s'",
                    mLogName.data(), mCallJoinCode.data());
      mRedirectorActive = OS_SUCCESS;

      // Record the two user-names that are excluded as being pick-up requests.
      mExcludedUser1 = mCallJoinCode;
      mExcludedUser1.append("*");
      mExcludedUser2 = mCallJoinCode;
      mExcludedUser2.append("#");
   }

   // Get the wait time for NOTIFYs in response to our SUBSCRIBEs.
   // Set the default value, to be overridden if the user specifies a valid
   // value.
   mWaitSecs = DEFAULT_WAIT_TIME_SECS;
   mWaitUSecs = DEFAULT_WAIT_TIME_USECS;
   Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
                 "%s::readConfig Default wait time is %d.%06d",
                 mLogName.data(), mWaitSecs, mWaitUSecs);
   // Fetch the parameter value.
   UtlString waitUS;
   float waitf;
   if (configDb.get(CONFIG_SETTING_WAIT, waitUS) == OS_SUCCESS)
   {
      Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
                    "%s::readConfig " CONFIG_SETTING_WAIT " is '%s'",
                    mLogName.data(), waitUS.data());
      // Parse the value, checking for errors.
      unsigned int char_count;
      sscanf(waitUS.data(), " %f %n", &waitf, &char_count);
      if (char_count != waitUS.length())
      {
         Os::Logger::instance().log(FAC_SIP, PRI_ERR,
                       "%s::readConfig Invalid format for "
                       CONFIG_SETTING_WAIT " '%s'",
                       mLogName.data(), waitUS.data());
      }
      else if (
         // Check that the value is in range.
         !(waitf >= MIN_WAIT_TIME && waitf <= MAX_WAIT_TIME))
      {
         Os::Logger::instance().log(FAC_SIP, PRI_ERR,
                       "%s::readConfig " CONFIG_SETTING_WAIT
                       " (%f) outside allowed range (%f to %f)",
                       mLogName.data(), waitf, MIN_WAIT_TIME, MAX_WAIT_TIME);
      }
      else
      {
         // Extract the seconds and microseconds, being careful to round
         // because the conversion from character data may have
         // been inexact.
         // Since waitf <= 100, usecs <= 100,000,000.
         int usecs = (int)((waitf * 1000000) + 0.0000005);
         mWaitSecs = usecs / 1000000;
         mWaitUSecs = usecs % 1000000;
         Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
                       "%s::readConfig Wait time is %d.%06d",
                       mLogName.data(), mWaitSecs, mWaitUSecs);
      }
   }
}
开发者ID:ClydeFroq,项目名称:sipxecs,代码行数:93,代码来源:SipRedirectorJoin.cpp

示例5: readConfig

// Read config information.
void SipRedirectorPresenceRouting::readConfig(OsConfigDb& configDb)
{
    // extract the realm information from the config DB - we need this part
    // to do the credentials db look-up.
    if ((configDb.get(CONFIG_SETTING_REALM, mRealm) != OS_SUCCESS) ||
         mRealm.isNull())
    {
        OsSysLog::add(FAC_SIP, PRI_ERR,
                     "%s::readConfig No Realm specified in the configuration",
                     mLogName.data());
    }
    else
    {
        OsSysLog::add(FAC_SIP, PRI_INFO,
                    "%s::readConfig mRealm = '%s'",
                    mLogName.data(), mRealm.data() );
   }

    mbForwardToVmOnBusy = configDb.getBoolean(CONFIG_SETTING_VOICEMAIL_ON_BUSY, FALSE);
    OsSysLog::add(FAC_SIP, PRI_INFO,
                 "%s::readConfig mbForwardToVmOnBusy = %d",
                 mLogName.data(), mbForwardToVmOnBusy);

    
    UtlString prefsFilename;
    configDb.get(CONFIG_SETTING_USER_PREFS_FILE, prefsFilename);
    OsSysLog::add(FAC_SIP, PRI_INFO,
                 "%s::readConfig prefsFilename = %s",
                 mLogName.data(), prefsFilename.data());
    mUserPrefs.loadPrefs( prefsFilename );
    
    UtlString openFirePresenceServerUrlAsString;
    if ((configDb.get(CONFIG_OPENFIRE_PRESENCE_SERVER_URL, openFirePresenceServerUrlAsString) != OS_SUCCESS) ||
          openFirePresenceServerUrlAsString.isNull())
    {
       OsSysLog::add(FAC_SIP, PRI_ERR,
                     "%s::readConfig No URL specified for openfire presence server in the configuration",
                     mLogName.data());
    }
    else
    {
        OsSysLog::add(FAC_SIP, PRI_INFO,
                    "%s::readConfig openFirePresenceServerUrlAsString = '%s'",
                    mLogName.data(), openFirePresenceServerUrlAsString.data() );
        mOpenFirePresenceServerUrl.fromString( openFirePresenceServerUrlAsString );
    }

    UtlString presenceMonitorServerUrlAsString;
    if ((configDb.get(CONFIG_PRESENCE_MONITOR_SERVER_URL, presenceMonitorServerUrlAsString) != OS_SUCCESS) ||
           presenceMonitorServerUrlAsString.isNull())
    {
         OsSysLog::add(FAC_SIP, PRI_ERR,
                       "%s::readConfig No URL specified for local presence monitor server in the configuration",
                       mLogName.data());
    }
    else
    {
        OsSysLog::add(FAC_SIP, PRI_INFO,
                      "%s::readConfig presenceMonitorServerUrlAsString = '%s'",
                      mLogName.data(), presenceMonitorServerUrlAsString.data() );
        mLocalPresenceMonitorServerUrl.fromString( presenceMonitorServerUrlAsString );
    }
}
开发者ID:astubbs,项目名称:sipxecs,代码行数:64,代码来源:SipRedirectorPresenceRouting.cpp

示例6: readConfig

// Read config information.
void SipRedirectorFallback::readConfig(OsConfigDb& configDb)
{
   configDb.get("MAPPING_RULES_FILENAME", mFileName);
   mAllowUnbound = configDb.getBoolean("ALLOW_UNBOUND", false);
}
开发者ID:maberchti,项目名称:sipxecs,代码行数:6,代码来源:SipRedirectorFallback.cpp


注:本文中的OsConfigDb::getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。