📄 uaconfiguration.cxx
字号:
case DeviceNameTag: { UaConfiguration::instance()->setDeviceName( value ); } break; case CallWaitingOnTag: { UaConfiguration::instance()->setCallWaitingOn( isEqualNoCase(string( value ), "True" ) ); } break; case CallIdOnTag: { UaConfiguration::instance()->setCallIdOn( isEqualNoCase( string( value ), "True" ) ); } break; case CallIdTag: { UaConfiguration::instance()->setCallId( value ); } break; case UaTimeoutTag: { int i; sscanf( value, "%d", &i ); UaConfiguration::instance()->setUaTimeout(i); } break; case SubscribeOnTag: { UaConfiguration::instance()->setSubscribeOn( isEqualNoCase( string( value ), "True" ) ); } break; case SubscribeToTag: { UaConfiguration::instance()->setSubscribeTo( value ); } break; case SubscribeExpireTag: { int i; sscanf( value, "%d", &i ); UaConfiguration::instance()->setSubscribeExpire( i ); } break; case VmServerTag: { UaConfiguration::instance()->addVMServer(string(value)); } break; case LogFileNameTag: { UaConfiguration::instance()->setLogFilename(string(value)); } break; case NATAddressTag: { UaConfiguration::instance()->setNATAddress(string(value)); } break; default: { cpLog( LOG_WARNING, "Unknown Tag: %s", tag ); } } /* switch */} // UaConfiguration::parseCfgFileCallBackvoidUaConfiguration::instance( const string cfgFile ){ assert( uaConfiguration == 0 ); uaConfiguration = new UaConfiguration; assert( uaConfiguration != 0 ); if(cfgFile.length()) { if( !parse3tuple( cfgFile.c_str(), parseCfgFileCallBack ) ) { // Stop UA exit( -1 ); } } uaConfiguration->show();} // UaConfiguration::instancevoidUaConfiguration::show(){ cpLog( LOG_INFO, "SIP User Agent Configuration" ); cpLog( LOG_INFO, "--- Device ---" ); cpLog( LOG_INFO, " Device Name : \"%s\"", getDeviceName().c_str() ); cpLog( LOG_INFO, "--- User ---" ); cpLog( LOG_INFO, " Name : \"%s\"", getUserName().c_str() ); cpLog( LOG_INFO, " Display Name : \"%s\"", getDisplayName().c_str() ); cpLog( LOG_INFO, " Pass Word : \"%s\"", getPassword().c_str() ); cpLog( LOG_INFO, "--- SIP ---" ); cpLog( LOG_INFO, " Port : \"%s\"", getLocalSipPort().c_str() ); cpLog( LOG_INFO, " Transport : \"%s\"", getSipTransport().c_str() ); cpLog( LOG_INFO, " Proxy Server : \"%s\"", getProxyServer().c_str() ); cpLog( LOG_INFO, "--- Registration ---" ); cpLog( LOG_INFO, " Register : \"%s\"", (getRegisterOn() ? "True" : "False" ) ); cpLog( LOG_INFO, " From : \"%s\"", getRegisterFrom().c_str() ); cpLog( LOG_INFO, " To : \"%s\"", getRegisterTo().c_str() ); cpLog( LOG_INFO, " Expires : %d s", getRegisterExpires() ); cpLog( LOG_INFO, " Action : \"%s\"", getRegisterAction().c_str() ); cpLog( LOG_INFO, "--- Subscribe ---" ); cpLog( LOG_INFO, " Subscribe : \"%s\"", (getSubscribeOn() ? "True" : "False" ) ); cpLog( LOG_INFO, " To : \"%s\"", getSubscribeTo().c_str() ); cpLog( LOG_INFO, " Expires : %d s", getSubscribeExpire() ); cpLog( LOG_INFO, "--- Dialing ---" ); cpLog( LOG_INFO, " Dial Timeout : %d ms", getInitialDigitTimeout() ); cpLog( LOG_INFO, "Interdigit Timeout : %d ms", getInterDigitTimeout() ); cpLog( LOG_INFO, "--- RTP ---" ); cpLog( LOG_INFO, " RTP Rate : %d ms", getNetworkRtpRate() ); cpLog( LOG_INFO, "--- Misc Features ---" ); cpLog( LOG_INFO, " Provide Ringback : \"%s\"", getProvideRingback() ? "True" : "False" ); string xfermode = "XferOff"; if ( getXferMode() == XferOn ) xfermode = "Transfer"; else if ( getXferMode() == ConfOn ) xfermode = "Conference"; cpLog( LOG_INFO, " Xfer Mode : \"%s\"", xfermode.c_str() ); cpLog( LOG_INFO, " Conference Server: \"%s\"", getConfServer().c_str() ); cpLog( LOG_INFO, " Call Waiting: \"%s\"", getCallWaitingOn() ? "True" : "False" ); cpLog( LOG_INFO, " Timeout: %d s", getUaTimeout() ); cpLog( LOG_INFO, " Min RTP Port : %d", getMinRtpPort() ); cpLog( LOG_INFO, " Max RTP Port : %d", getMaxRtpPort() ); cpLog( LOG_INFO, "--- Dial Patterns ---" ); DialingPlanListType dp = getDialPlans(); DialingPlanListType::iterator dpIter = dp.begin(); while ( dpIter != dp.end() ) { cpLog( LOG_INFO, "%18d : %s", (*dpIter)->getDialMethod(), (*dpIter)->getDialPattern().c_str() ); dpIter++; } cpLog( LOG_INFO, "--- Speed Dials ---" ); SpeedDialMapType sd = getSpeedDials(); SpeedDialMapType::iterator sdIter = sd.begin(); while ( sdIter != sd.end() ) { cpLog( LOG_INFO, "%18s : %s", sdIter->first.c_str(), sdIter->second.c_str() ); sdIter++; } cpLog( LOG_INFO, "--- Manual CallId ---" ); cpLog( LOG_INFO, " Manual CallId: \"%s\"", (getCallIdOn() ? "True" : "False" ) ); cpLog( LOG_INFO, " CallId: \"%s\"", getCallId().c_str() ); // Display Load Gen info only if it's set. if (getLoadGenOn()) { cpLog( LOG_INFO, "--- Load Generation is turned on ---"); cpLog( LOG_INFO, " RunMode: \"%s\"", getRunMode().c_str() ); cpLog( LOG_INFO, " StartTime: %d ms", getStartTime() ); cpLog( LOG_INFO, " NumKickStarts: %d", getNumKickStarts() ); cpLog( LOG_INFO, " Call Url: %d", getCallUrl().c_str() ); cpLog( LOG_INFO, "* NumEndpoints: %d", getNumEndpoints() ); cpLog( LOG_INFO, " CallDuration: %d ms", getCallDuration() ); cpLog( LOG_INFO, " CallDelay: %d ms", getCallDelay() ); cpLog( LOG_INFO, " CallRestartTimer: %d ms", getCallRestartTimer() ); cpLog( LOG_INFO, " AnswerRestartTimer: %d ms", getAnswerRestartTimer() ); cpLog( LOG_INFO, "* AnswerDelay: %d ms", getAnswerDelay() ); if ( getMonitorMsgOn() ) { cpLog( LOG_INFO, " MonitorMsgOn: True" ); cpLog( LOG_INFO, " MonitorMsgInterval: %d sec", getMonitorMsgInterval() ); } else { cpLog( LOG_INFO, " MonitorMsgOn: False" ); } cpLog( LOG_INFO, " First Dialing #: \"%s\"", getDialNumber().c_str() ); if ( getRtpGenOn() ) { cpLog( LOG_INFO, " RtpGenOn: True"); } else { cpLog( LOG_INFO, " RtpGenOn: False"); } cpLog( LOG_INFO, " NumOfCalls: %d", getNumOfCalls() ); if ( getCJTimeOfDay() ) { cpLog( LOG_INFO, " CJTimeOfDay: True" ); } } else { cpLog( LOG_INFO, "--- Load Generation is turned off ---"); }; cpLog( LOG_INFO, "\n\n");} // UaConfiguration::showstringUaConfiguration::getUserName(){ return userName;} // UaConfiguration::getUserNamestringUaConfiguration::getDisplayName(){ return displayName;} // UaConfiguration::getDisplayNamestringUaConfiguration::getPassword(){ return password;} // UaConfiguration::getPasswordstringUaConfiguration::getLocalSipPort(){ return localSipPort;} // UaConfiguration::getLocalSipPortintUaConfiguration::getMinRtpPort(){ return minRtpPort;} intUaConfiguration::getMaxRtpPort(){ return maxRtpPort;}stringUaConfiguration::getSipTransport(){ return sipTransport;} // UaConfiguration::getSipTransportstringUaConfiguration::getProxyServer(){ return proxyServer;} // UaConfiguration::getProxyServerboolUaConfiguration::getRegisterOn(){ return registerOn;} // UaConfiguration::getRegisterOnstringUaConfiguration::getRegisterFrom(){ return registerFrom;} // UaConfiguration::getRegisterFromstringUaConfiguration::getRegisterTo(){ return registerTo;} // UaConfiguration::getRegisterTointUaConfiguration::getRegisterExpires(){ return registerExpires;} // UaConfiguration::getRegisterExpiresstringUaConfiguration::getRegisterAction(){ return registerAction;} // UaConfiguration::getRegisterActionintUaConfiguration::getNetworkRtpRate(){ return networkRtpRate;} // UaConfiguration::getNetworkRtpRateboolUaConfiguration::getProvideRingback(){ return provideRingback;} // UaConfiguration::getNetworkRtpRateintUaConfiguration::getInitialDigitTimeout(){ return initialDigitTimeout;} // UaConfiguration::getInitialDigitTimeoutintUaConfiguration::getInterDigitTimeout(){ return interDigitTimeout;} // UaConfiguration::getInterDigitTimeoutDialingPlanListType&UaConfiguration::getDialPlans(){ return dialPlans;} // UaConfiguration::getDialPlansSpeedDialMapType&UaConfiguration::getSpeedDials(){ return speedDials;} // UaConfiguration::getSpeedDialsUaXferModeUaConfiguration::getXferMode() const{ return xferMode;}stringUaConfiguration::getConfServer() const{ return confServer;}voidUaConfiguration::setUserName( string name ){ userName = name;} // UaConfiguration::setUserNamevoidUaConfiguration::setDisplayName( string name ){ displayName = name;} // UaConfiguration::setDisplayNamevoidUaConfiguration::setPassword( string pwd ){ password = pwd;} // UaConfiguration::setPasswordvoidUaConfiguration::setLocalSipPort( string port ){ localSipPort = port;} // UaConfiguration::setLocalSipPortvoidUaConfiguration::setMinRtpPort( int port ){ minRtpPort = port;} // UaConfiguration::getMinRtpPortvoidUaConfiguration::setMaxRtpPort( int port ){ maxRtpPort = port;} // UaConfiguration::getMaxRtpPortvoidUaConfiguration::setSipTransport( string transport ){ sipTransport = transport;} // UaConfiguration::setSipTransportvoidUaConfiguration::setProxyServer( string server ){ proxyServer = server;} // UaConfiguration::setProxyServervoidUaConfiguration::setRegisterOn( bool on ){ registerOn = on;} // UaConfiguration::setRegisterOnvoidUaConfiguration::setRegisterFrom( string from ){ registerFrom = from;} // UaConfiguration::setRegisterFromvoidUaConfiguration::setRegisterTo( string to ){ registerTo = to;} // UaConfiguration::setRegisterTovoidUaConfiguration::setRegisterExpires( int expires ){ registerExpires = expires;} // UaConfiguration::setRegisterExpiresvoidUaConfiguration::setRegisterAction( string action ){ registerAction = action;} // UaConfiguration::setRegisterActionvoidUaConfiguration::setNetworkRtpRate( int rate ){ networkRtpRate = rate;} // UaConfiguration::setNetworkRtpRatevoidUaConfiguration::setProvideRingback( bool ringback ){ provideRingback = ringback;} // UaConfiguration::setNetworkRtpRatevoidUaConfiguration::setInitialDigitTimeout( int timeout ){ initialDigitTimeout = timeout;} // UaConfiguration::setInitialDigitTimeoutvoidUaConfiguration::setInterDigitTimeout( int timeout ){ interDigitTimeout = timeout;} // UaConfiguration::setInterDigitTimeoutvoidUaConfiguration::addDialPattern( DialMethodsType type, string pattern ){ DialingPlan* plan = new DialingPlan( pattern, type ); dialPlans.push_back( plan );} // UaConfiguration::addDialPatternvoidUaConfiguration::addSpeedDial( string key, string dest ){ speedDials[ key ] = dest;} // UaConfiguration::addSpeedDial/* Load Generation stuff */boolUaConfiguration::getLoadGenOn()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -